本文整理汇总了PHP中get_msg函数的典型用法代码示例。如果您正苦于以下问题:PHP get_msg函数的具体用法?PHP get_msg怎么用?PHP get_msg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_msg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_exchange
function get_exchange($imap_box)
{
$emails = imap_search($imap_box, "FROM 'e-mail address'");
//ищем письма от
//$emails = imap_search($imap_box, "FROM 'e-mail address'"); //ищем письма от
//echo "<br>";
//if ($emails) echo "Найдено:" . sizeof($emails) . " писем.<br>"; // сколько нашли и какие их номера начиная с 0
//else echo "Писем удовлетворяющих условию не найдено.";
$result = false;
if ($emails) {
/* put the newest emails on top */
rsort($emails);
/* for every email... */
foreach ($emails as $email_number) {
$message = get_msg($imap_box, $email_number, "PLAIN");
// PLAIN or HTML or ...
$message = preg_replace('/\\r\\n|\\r|\\n/u', '', $message);
// удаляем символы перевода строки
preg_match("/Курс виписки рахунків- \\d\\d\\,\\d\\dГотівковий- \\d\\d\\,\\d\\d/", $message, $output_array);
//ищем паттерн
if ($output_array[0]) {
// Если нашли паттерн
if (!$result) {
preg_match_all('/\\d\\d\\,\\d\\d/', $output_array[0], $result);
}
//нашли свежак и сохраняем его
imap_delete($imap_box, $email_number);
//помечаем письмо на удаление
}
}
}
imap_expunge($imap_box);
return $result[0];
}
示例2: init
/**
* Set the User geolocation and page
*/
function init($link = null, $id = null, $online_time = USER_ONLINE_TIME)
{
$file = basename($_SERVER['SCRIPT_FILENAME']);
$url = $_SERVER['REQUEST_URI'];
$user_localization = isset($_SESSION['user_localization']) ? $_SESSION['user_localization'] : null;
$sid = session_id();
$browser = BROWSER . " " . BROWSER_VERSION;
$os = BROWSER_OS;
$ip = IP;
if (!$user_localization) {
$time = TIME - HOUR;
DB::query("DELETE FROM " . DB_PREFIX . "user_localization WHERE time < " . HOUR);
}
$user_localization_id = $user_localization ? $_SESSION['user_localization']['user_localization_id'] : DB::get_field("SELECT user_localization_id FROM " . DB_PREFIX . "user_localization WHERE sid='{$sid}'");
if ($user_id = User::get_user_id()) {
$guest_id = 0;
$name = User::get_user_field("name");
} else {
$guest_id = isset($user_localization['guest_id']) ? $user_localization['guest_id'] : 1 + DB::get_field("SELECT guest_id FROM " . DB_PREFIX . "user_localization ORDER BY guest_id DESC LIMIT 1;");
$name = get_msg('guest') . " " . $guest_id;
}
if ($user_localization_id) {
DB::query("UPDATE " . DB_PREFIX . "user_localization SET ip='{$ip}', user_id='{$user_id}', name='{$name}', url='{$url}', id='{$id}', file='{$file}', time='" . TIME . "', sid='{$sid}' WHERE user_localization_id='{$user_localization_id}'");
} else {
if (!($location = ip_to_location($ip, $assoc = true))) {
$location = array('CountryCode' => null, 'CountryName' => null, 'RegionCode' => null, 'RegionName' => null, 'City' => null, 'ZipPostalCode' => null, 'Latitude' => null, 'Longitude' => null, 'TimezoneName' => null, 'Gmtoffset' => null);
}
//replace_sql_injection( $location );
DB::query("INSERT INTO " . DB_PREFIX . "user_localization\r\n (ip,sid,user_id,guest_id,name,url,id,file,os,browser,time,time_first_click,country_code,country_name,region_code,region_name,city_name,zip,latitude,longitude,timezone_name,gmt_offset)\r\n VALUES\r\n ('{$ip}','{$sid}','{$user_id}','{$guest_id}','{$name}','{$url}','{$id}','{$file}','{$os}','{$browser}', " . TIME . ", " . TIME . ", '{$location['CountryCode']}', '{$location['CountryName']}', '{$location['RegionCode']}', '{$location['RegionName']}','{$location['City']}', '{$location['ZipPostalCode']}', '{$location['Latitude']}', '{$location['Longitude']}', '{$location['TimezoneName']}', '{$location['Gmtoffset']}')");
$user_localization_id = DB::get_last_id();
}
$_SESSION['user_localization'] = array('user_localization_id' => $user_localization_id, 'id' => $id, 'guest_id' => $guest_id, 'name' => $name, 'time' => TIME, 'file' => $file, 'user_id' => $user_id, 'os' => $os, 'browser' => $browser);
}
示例3: time_elapsed
/**
* 格式化日期 e.g. 3 days ago, or 5 minutes ago to a maximum of a week ago
*
* @param int $time unix timestamp
* @param string format of time (use the constant fdate_format or ftime_format)
*/
function time_elapsed($time = null, $format)
{
$diff = TIME - $time;
if ($diff < MINUTE) {
return $diff . " " . get_msg('seconds_ago');
} elseif ($diff < HOUR) {
return ceil($diff / 60) . " " . get_msg('minutes_ago');
} elseif ($diff < 12 * HOUR) {
return ceil($diff / 3600) . " " . get_msg('hours_ago');
} elseif ($diff < DAY) {
return get_msg('today') . " " . strftime(TIME_FORMAT, $time);
} elseif ($diff < DAY * 2) {
return get_msg('yesterday') . " " . strftime(TIME_FORMAT, $time);
} elseif ($diff < WEEK) {
return ceil($diff / DAY) . " " . get_msg('days_ago') . " " . strftime(TIME_FORMAT, $time);
} else {
return strftime($format, $time);
}
}
示例4: drop
function drop()
{
if (!IS_POST) {
$this->display('goods.batch.html');
} else {
$id = isset($_POST['id']) ? trim($_POST['id']) : '';
if (!$id) {
$this->show_warning('Hacking Attempt');
return;
}
$ids = explode(',', $id);
// notify store owner
$ms =& ms();
$goods_list = $this->_goods_mod->find(array("conditions" => $ids, "fields" => "goods_name, store_id"));
foreach ($goods_list as $goods) {
//$content = sprintf(LANG::get('toseller_goods_droped_notify'), );
$content = get_msg('toseller_goods_droped_notify', array('reason' => trim($_POST['drop_reason']), 'goods_name' => addslashes($goods['goods_name'])));
$ms->pm->send(MSG_SYSTEM, $goods['store_id'], '', $content);
}
// drop
$this->_goods_mod->drop_data($ids);
$this->_goods_mod->drop($ids);
$ret_page = isset($_GET['ret_page']) ? intval($_GET['ret_page']) : 1;
$this->show_message('drop_ok', 'back_list', 'index.php?app=goods&page=' . $ret_page);
}
}
示例5: cancel
function cancel()
{
$id = empty($_GET['id']) ? 0 : $_GET['id'];
if (!$id) {
$this->show_warning('no_such_groupbuy');
return false;
}
if (!$this->_ican($id, ACT)) {
$this->show_warning('Hacking Attempt');
return;
}
/* 团购信息 */
$group = $this->_groupbuy_mod->get(array('conditions' => 'group_id=' . $id, 'fields' => 'group_desc,group_name,owner_name', 'join' => 'belong_store'));
if (!IS_POST) {
/* 当前位置 */
$this->_curlocal(LANG::get('member_center'), 'index.php?app=member', LANG::get('groupbuy_manage'), 'index.php?app=seller_groupbuy', LANG::get('cancel_groupbuy'));
/* 当前用户中心菜单 */
$this->_curitem('groupbuy_manage');
/* 当前所处子菜单 */
$this->_curmenu('cancel_groupbuy');
$this->assign('group', $group);
$this->_config_seo('title', Lang::get('member_center') . ' - ' . Lang::get('desc_groupbuy'));
$this->display('seller_groupbuy.cancel.html');
} else {
if (!$this->_groupbuy_mod->edit($id, array('state' => GROUP_CANCELED))) {
$this->show_warning($this->_groupbuy_mod->get_error());
return;
}
$content = get_msg('tobuyer_groupbuy_cancel_notify', array('reason' => $_POST['reason'], 'url' => SITE_URL . '/' . url("app=groupbuy&id={$id}")));
$this->_groupbuy_mod->sys_notice($id, array('admin', 'buyer'), '', $content, array('msg'));
$this->show_message('cancel_ok', 'back_list', 'index.php?app=seller_groupbuy');
}
}
示例6: switch
switch ($status) {
case 'Open':
echo "<h1>Open Orders</h1>";
myOrders('Open', $custID);
break;
case 'Closed':
echo "<h1>Past Orders</h1>";
myOrders('Closed', $custID);
break;
}
}
if (isset($_GET['orderID']) && !isset($_GET['noOrders'])) {
$orderID = $_GET['orderID'];
$db->runQuery("select CL.id, CL.date,L.description, L.status, L.type, E.first_name as 'employee_first_name',\r E.last_name as 'employee_last_name',E.email as 'employee_email' from customer_leads CL, leads L, employees E\r where CL.id = {$orderID} and\r CL.employee_id = E.id and L.id = CL.id;");
$rows = $db->result->fetch_object();
$pdata = json_encode($rows);
}
if (isset($_GET['noOrders'])) {
echo "<h2>You donot have any orders yet.</h2>";
}
?>
<div id="profileBox"></div>
<script type="text/javascript">
showMsg('<?php
get_msg();
?>
');
var pdata = <?php
echo $pdata;
示例7: sec_to_string
/**
* Convert seconds to string, eg. "2 minutes", "1 hour", "16 seconds"
*/
function sec_to_string($sec)
{
$str = null;
if ($hours = intval(intval($sec) / 3600)) {
$str .= $hours > 1 ? $hours . " " . get_msg('hours') : $hours . " " . get_msg('hour');
}
if ($minutes = intval($sec / 60 % 60)) {
$str .= $minutes > 1 ? $minutes . " " . get_msg('minutes') : $minutes . " " . get_msg('minute');
}
if ($seconds = intval($sec % 60)) {
$str .= $seconds > 1 ? $seconds . " " . get_msg('seconds') : $seconds . " " . get_msg('second');
}
return $str;
}
示例8: get_user
function get_user($user_id = null)
{
if ($user_id) {
$user = DB::get_row("SELECT * FROM " . DB_PREFIX . "user WHERE user_id = '{$user_id}'");
$user['level'] = get_msg(strtolower($GLOBALS['user_level'][$user['status']]));
return $user;
} else {
return isset(self::$user) ? self::$user : null;
}
}
示例9: ld_msg
function ld_msg($msg_code = 'err_000', $param = '')
{
static $_language_item = array();
if (!isset($_language_item[$msg_code])) {
$msg =& get_msg();
if (!isset($msg[$msg_code])) {
show_error("Your language file does not appear to be formatted correctly.");
}
$_language_item[$msg_code] = $msg[$msg_code];
}
return str_replace('{%s}', $param, $_language_item[$msg_code]);
}
示例10: _draw_page_not_found
/**
* Page was not found
*
* @param string $msg, message for the page not found
*/
protected function _draw_page_not_found($msg = "page_not_found")
{
header("HTTP/1.0 404 Not Found");
$this->page_layout = $this->not_found_layout;
$this->assign("message", get_msg($msg));
$this->draw();
die;
}
示例11: switch
}
switch ($tela) {
case 'gerenciar':
?>
<div class="twelve columns">
<script type="text/javascript">
$(function(){
$('.deletareg').click(function(){
if(confirm("Deseja Realmente excluir este registro?\nEsta Operação não poderá ser desfeita!"))return true; else return false;
});
});
</script>
<?php
echo breadcrumb();
get_msg('msgok');
get_msg('msgerro');
$modo = $this->uri->segment(3);
if ($modo == 'all') {
$limit = 0;
} else {
$limit = 50;
echo '<p>Mostrando os últimos 50 registros, para ver todo o histórico ' . anchor('auditoria/gerenciar/all', 'Clique aqui') . ' </p>';
}
?>
<table class="twelve data-table">
<thead>
<tr>
<th>Usuário</th>
<th>Data e Hora</th>
<th>Operação</th>
示例12: switch
}
switch ($tela) {
case 'cadastrar':
echo bt_row(array(form_open_multipart('midia/cadastrar'), form_fieldset(), bt_col(12, array(get_msg('msgok'), get_msg('msgerro'), erros_validacao())), bt_col(12, bt_input('Titulo midia', 'nome', 4)), bt_col(12, bt_input('Descrição', 'descricao', 2)), bt_col(12, bt_input('Alt', 'alt', 2)), bt_col(12, bt_form(12, array(form_label('Arquivo'), form_upload(array('name' => 'arquivo'), set_value('arquivo'))))), bt_col(12, array(anchor('midia/gerenciar', 'Canselar', array('class' => 'btn btn-danger espaco')), bt_submit('Salvar', 'cadastrar', 4, 3))), form_fieldset_close(), form_close()));
break;
case 'editar':
$id = $this->uri->segment(3);
if ($id == NULL) {
set_msg('msgerro', 'Não foi informado uma midia valido.', 'aviso');
redirect('midia/gerenciar');
}
$query = $this->midia->get_byid($id)->row();
echo bt_row(array(form_open(current_url()), form_fieldset(), bt_col(12, array(get_msg('msgok'), get_msg('msgerro'), erros_validacao())), bt_col(6, array(bt_col(12, bt_input_cont('Titulo midia', 'nome', 12, $query->nome)), bt_col(12, bt_input_cont('Descrição', 'descricao', 12, $query->descricao)), bt_col(12, bt_input_cont('Alt', 'alt', 12, $query->alt)), bt_col(12, array(anchor('midia/gerenciar', 'Canselar', array('class' => 'btn btn-danger espaco')), bt_submit('Salvar', 'cadastrar', 4, 3))))), bt_col(6, trumb($query->arquivo, 300, 250, TRUE, $query->alt)), form_hidden('id', $id), form_fieldset_close(), form_close()));
break;
case 'gerenciar':
bt_row(bt_col(12, array(get_msg('msgok'), get_msg('msgerro'))));
?>
<div class="table-responsive">
<table class="table table-hover table-striped data-table">
<thead>
<tr>
<th>Nome<i class="fa"></i></th>
<th>Link<i class="fa"></i></th>
<th>Miniaturar<i class="fa"></i></th>
<th class="text-center">Ação<i class="fa"></i></th>
</tr>
</thead>
<?php
$query = $this->midia->get_all()->result();
示例13: _update_store_state
function _update_store_state()
{
$store_mod =& m('store');
$stores = $store_mod->find(array('conditions' => "state = '" . STORE_OPEN . "' AND end_time > 0 AND end_time < '" . gmtime() . "'", 'join' => 'belongs_to_user', 'fields' => 'store_id, user_id, user_name, email'));
foreach ($stores as $store) {
$subject = Lang::get('close_store_notice');
$content = get_msg('toseller_store_closed_notify', array('reason' => Lang::get('close_reason')));
/* 连接用户系统 */
$ms =& ms();
$ms->pm->send(MSG_SYSTEM, $store['user_id'], '', $content);
$this->_mailto($store['email'], $subject, $content);
$store_mod->edit($store['store_id'], array('state' => STORE_CLOSED, 'close_reason' => Lang::get('close_reason')));
}
}
示例14: index
function index()
{
$id = empty($_GET['id']) ? 0 : intval($_GET['id']);
if (!$id) {
$this->show_warning('no_such_groupbuy');
return false;
}
// 团购信息
$group = $this->_groupbuy_mod->get(array('conditions' => 'group_id=' . $id . ' AND gb.state<>' . GROUP_PENDING, 'join' => 'belong_store', 'fields' => 'gb.*,s.owner_name'));
if (empty($group)) {
$this->show_warning('no_such_groupbuy');
return;
}
// 团购商品信息
$goods = $this->_query_goods_info($group['goods_id']);
if ($goods['closed'] == 1) {
$this->show_warning('groupbuy_goods_closed');
return;
}
if (!IS_POST) {
$data['views'] = $group['views'] + 1;
// 浏览数
if ($group['end_time'] < gmtime() && $group['state'] == GROUP_ON) {
$group['state'] = GROUP_END;
// 结束团购
/* 通知卖家 */
$content = get_msg('toseller_groupbuy_end_notify', array('cancel_days' => GROUP_CANCEL_INTERVAL));
$this->_groupbuy_mod->sys_notice($id, array('seller'), '', $content, array('msg'));
} else {
if ($group['end_time'] + GROUP_CANCEL_INTERVAL * 3600 * 24 < gmtime() && $group['state'] == GROUP_END) {
$group['state'] = GROUP_CANCELED;
// 取消团购
/* 通知买家和站长 */
$content = get_msg('tobuyer_group_auto_cancel_notify', array('cancel_days' => GROUP_CANCEL_INTERVAL, 'url' => SITE_URL . '/' . url("app=groupbuy&id={$id}")));
$this->_groupbuy_mod->sys_notice($id, array('admin', 'buyer'), '', $content, array('msg'));
}
}
$data['state'] = $group['state'];
$this->_groupbuy_mod->edit($id, $data);
// 订购数
$group['quantity'] = $this->_groupbuy_mod->get_join_quantity($id);
// 进度
$group['left_quantity'] = $group['min_quantity'] - $group['quantity'];
$group['left_per'] = 100 - intval(100 * $group['quantity'] / $group['min_quantity']);
$group['left_per'] < 0 && ($group['left_per'] = 0);
// 状态描述
$group['state_desc'] = $this->_get_state_desc($group['state'], $group['end_time']);
// 团购规格价格
$group['spec_price'] = unserialize($group['spec_price']);
// 可执行操作
$group['ican'] = $this->_ican($group['group_id'], $group['state'], $group['store_id']);
// 参团记录
$join_list = $this->_groupbuy_mod->get_join_list($id);
foreach ($goods['_specs'] as $key => $spec) {
if (empty($group['spec_price'][$spec['spec_id']])) {
unset($goods['_specs'][$key]);
} else {
$goods['_specs'][$key]['group_price'] = $group['spec_price'][$spec['spec_id']]['price'];
if (isset($join_list[$this->_visitor['user_id']])) {
$goods['_specs'][$key]['my_qty'] = $join_list[$this->_visitor['user_id']]['spec_quantity'][$spec['spec_id']]['qty'];
}
}
}
// 店铺信息
$this->set_store($goods['store_id']);
$store = $this->get_store_data();
// 当前位置
$this->_curlocal(array(array('text' => Lang::get('groupbuy'), 'url' => url('app=search&act=groupbuy')), array('text' => $group['group_name'])));
// 团购咨询数据
$data = $this->_get_groupbuy_qa($id);
if (Conf::get('captcha_status.goodsqa')) {
$this->assign('captcha', 1);
}
$this->assign('email', $data['email']);
$this->assign('page_info', $data['page_info']);
$this->assign('qa_info', $data['qa_info']);
/* 页面标题 */
$this->_config_seo('title', $group['group_name'] . ' - ' . Lang::get('groupbuy') . ' - ' . Conf::get('site_title'));
$this->_import_resource();
$this->assign('store', $store);
$this->assign('goods', $goods);
$this->assign('group', $group);
$this->assign('guest_comment_enable', Conf::get('guest_comment'));
$this->assign('join_list', $join_list);
$this->display('groupbuy.index.html');
} else {
if (isset($_POST['join'])) {
$quantity = 0;
$spec_quantity = array();
foreach ($_POST['quantity'] as $key => $val) {
if ($_POST['quantity'][$key] > 0) {
$spec_quantity[$_POST['spec_id'][$key]] = array('spec' => $_POST['spec'][$key], 'qty' => $_POST['quantity'][$key]);
$quantity += $_POST['quantity'][$key];
} elseif ($_POST['quantity'][$key] != '') {
$this->show_warning('invalid_quantity');
return;
}
}
if ($quantity == 0) {
$this->show_warning('fill_quantity');
//.........这里部分代码省略.........
示例15: form_open
<div class="row">
<?php
echo '<div class="small-4 small-centered large-4 columns large-centered">';
echo form_open('usuarios/login', array('class' => 'custom login-form'));
echo form_fieldset('Identifique-se');
erros_validacao();
get_msg('logoffok');
get_msg('errologin');
echo form_label('Usuário');
echo form_input(array('name' => 'usuario'), set_value('usuario'), 'autofocus');
echo form_label('Senha');
echo form_password(array('name' => 'senha'), set_value('senha'));
echo form_hidden('redirect', $this->session->userdata('redir_para'));
echo form_submit(array('name' => 'logar', 'class' => 'button radius right'), 'Login');
echo "<p>" . anchor('usuarios/nova_senha', 'Esqueci minha senha') . '<p>';
echo form_fieldset_close();
echo form_close();
echo "</div>";
?>
</div>