本文整理汇总了PHP中FLEA::getSingleton方法的典型用法代码示例。如果您正苦于以下问题:PHP FLEA::getSingleton方法的具体用法?PHP FLEA::getSingleton怎么用?PHP FLEA::getSingleton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLEA
的用法示例。
在下文中一共展示了FLEA::getSingleton方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionDeliveryDetailList
function actionDeliveryDetailList()
{
//过滤语句
$using = new class_using();
$request = $using->safeUsing('request', 'controller:string,action:string');
$this->_model =& FLEA::getSingleton('model_rep');
//出货表
$rep = $this->_model->find(array('ID' => $request['kcreport'], 'ID' => $request['actionDeliveryDetailList']));
if ($rep) {
$this->_model =& FLEA::getSingleton('model_grid');
//表字段
$grid = $this->_model->findAll(array('RepID' => $rep['ID']));
//设置查询语句
$dbo =& FLEA::getDBO();
$this->sql = $rep['select FCustomerCode,FCustomerName,FDate,FSODate from v_delivery'];
//查询条件-按日期查询
///此处可修改>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
$cond = new class_conditions();
$formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d");
$todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d");
$FCustomer = isset($request['FCustomer']) ? trim($this->u2gbk($request['FCustomer'])) : null;
$cond->between($formdate, $todate, 'FDate', 'D', 2);
$cond->equal($FCustomer, 'FCustomerCode', 'S', ' and ');
///此处可修改<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
//排序
$order = new class_order($request);
//获取当前页
$page['cid'] = isset($request['pageNum']) && intval($request['pageNum']) > 0 ? intval($request['pageNum']) : 1;
$page['size'] = isset($request['numPerPage']) && intval($request['numPerPage']) > 0 ? intval($request['numPerPage']) : 20;
echo $this->sql;
//获取SQL查询的全部记录
$alldata = $dbo->getAll($this->sql . $cond->getWhere() . $order->getOrder());
//获取SQL查询的记录总数
$page['count'] = count($alldata);
//$allFProfit =$this->_count($alldata,'FProfit');
//$allFSaleAmount =$this->_count($alldata,'FSaleAmount');
//记录偏移量
$page['offset'] = ($page['cid'] - 1) * $page['size'] > $page['count'] ? $page['count'] : ($page['cid'] - 1) * $page['size'];
$data = array_slice($alldata, $page['offset'], $page['size'], true);
//处理查询结果
if (isset($data)) {
///此处可修改>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
$this->_smarty->assign('formdate', $formdate);
$this->_smarty->assign('todate', $todate);
$this->_smarty->assign('FCustomer', $FCustomer);
///此处可修改<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$this->_smarty->assign('orderField', $order->getField());
$this->_smarty->assign('orderDirection', $order->getDirection());
$this->_smarty->assign('page', $page);
$this->_smarty->assign('data', $data);
$this->_smarty->assign('grid', $grid);
$this->_smarty->assign('alldata', $alldata);
$this->_smarty->assign('allFProfit', $allFProfit);
$this->_smarty->assign('allFSaleAmount', $allFSaleAmount);
$this->_smarty->display('kc.DeliveryDetailList.htm');
}
} else {
$this->_smarty->display('norepinfo.htm');
}
}
示例2: actionchangepwd
function actionchangepwd()
{
$rbac =& FLEA::getSingleton('FLEA_Rbac');
$SE = $rbac->getUser();
$username = isset($SE['USERNAME']) ? $SE['USERNAME'] : '';
$this->_smarty->display('changepwd.htm');
}
示例3: actionLogin
/**
* 登录
*/
function actionLogin()
{
do {
/**
* 验证用户名和密码是否正确
*/
$modelSysUsers =& FLEA::getSingleton('Model_SysUsers');
$user = $modelSysUsers->findByUsername($_POST['username']);
if (!$user) {
$msg = _T('ui_l_invalid_username');
break;
}
if (!$modelSysUsers->checkPassword($_POST['password'], $user['password'])) {
$msg = _T('ui_l_invalid_password');
break;
}
/**
* 登录成功,通过 RBAC 保存用户信息和角色
*/
$data = array();
$data['ADMIN'] = $user['username'];
$rbac =& FLEA::getSingleton('FLEA_Rbac');
/* @var $rbac FLEA_Rbac */
$rbac->setUser($data, array('SYSTERM_ADMIN'));
//重定向
redirect(url('ZobAdmin'));
} while (false);
//登录发生错误,再次显示登录界面
$ui =& FLEA::initWebControls();
include APP_DIR . '/ZobLoginIndex.php';
}
示例4: Controller_ZobHome
/**
* 构造函数
*
* @return Controller_ZobHome
*/
function Controller_ZobHome()
{
parent::Controller_ZobBase();
$this->_modelMembers =& FLEA::getSingleton('Model_Members');
$this->_modelPosts =& FLEA::getSingleton('Model_Posts');
$this->_modelProjects =& FLEA::getSingleton('Model_Projects');
}
示例5: socketconn
public function socketconn($ip, $port)
{
$_G = FLEA::getSingleton("Util_Msg");
$this->socket = @fsockopen($ip, $port, $errNo, $errstr, 30);
if (!$this->socket) {
$_G->customshow("建立Socket连接失败", "socket", "Index", 3, 0);
exit;
}
}
示例6: Controller_Default
/**
* 构造函数
*
* @return Controller_Default
*/
function Controller_Default()
{
/**
* FLEA::getSingleton() 会自动载入指定类的定义文件,并且返回该类的唯一一个实例
*/
$this->_metas =& FLEA::getAppInf('metas');
$this->_modelNews =& FLEA::getSingleton('Model_News');
$this->_modelMessage =& FLEA::getSingleton('Model_Message');
$this->_modelGoods =& FLEA::getSingleton('Model_Goods');
}
示例7: log_message
/**
* 追加日志记录
*
* @param string $msg
* @param string $level
*/
function log_message($msg, $level = 'log', $title = '')
{
static $instance = null;
if (is_null($instance)) {
$instance = array();
$obj =& FLEA::getSingleton('FLEA_Log');
$instance = array('obj' => &$obj);
}
return $instance['obj']->appendLog($msg, $level, $title);
}
示例8: Controller_Admin
/**
* 构造函数
*/
function Controller_Admin()
{
/**
* FLEA::getSingleton() 会自动载入指定类的定义文件,并且返回该类的唯一一个实例
*/
$this->_modelNews =& FLEA::getSingleton('Model_News');
$this->_modelMessage =& FLEA::getSingleton('Model_Message');
$this->_modelGoods =& FLEA::getSingleton('Model_Goods');
$this->_modelCategory =& FLEA::getSingleton('Model_Category');
}
示例9: actionlookup
function actionlookup()
{
$this->_model =& FLEA::getSingleton('model_depart');
$departs = $this->_model->findAll();
//通用生成树函数
//@param:$arrs 树结构数组
//@param:$keyparam 显示的字段 例如:array('code','name') ,节点将显示“ 编码-名称” 形式
//@param:$$outparam 双击节点带回数值的字段
function maketree($arrs, $keyparam, $outparam)
{
if (isset($arrs) && is_array($arrs)) {
foreach ($arrs as $arr) {
echo '<li>';
echo '<a ';
if (isset($outparam) && is_array($outparam)) {
echo 'ondblclick=\'javascript:$.bringBack({';
for ($i = 0; $i < count($outparam); $i++) {
if ($i > 0) {
echo ',';
}
echo $outparam[$i] . ':"' . $arr[$outparam[$i]] . '"';
}
echo '})\' title="双击选中" ';
}
echo '>';
if (isset($keyparam) && is_array($keyparam)) {
for ($i = 0; $i < count($keyparam); $i++) {
if ($i > 0) {
echo '-';
}
echo $arr[$keyparam[$i]];
}
}
echo '</a>';
if (isset($arr['child'])) {
echo '<ul>';
maketree($arr['child'], $keyparam, $outparam);
echo '</ul>';
}
echo '</li>';
}
}
}
if (isset($departs)) {
//生成部门树结构
$tree = new class_tree($departs);
$departs = $tree->leaf(0);
//设置参数
$this->_smarty->assign('arrs', $departs);
$this->_smarty->assign('keyparam', array('code', 'name'));
$this->_smarty->assign('outparam', array('id', 'code', 'name'));
$this->_smarty->display('departlookup.htm');
}
}
示例10: Controller_Feedback
/**
* 构造函数
*
* @return Controller_Default
*/
function Controller_Feedback()
{
/**
* FLEA::getSingleton() 会自动载入指定类的定义文件,并且返回该类的唯一一个实例
*/
$this->_modelMessage =& FLEA::getSingleton('Model_Message');
$this->_metas =& FLEA::getAppInf('metas');
$this->_metas['description'] = "辽宁万维医药经销渠道客户回馈";
$this->_metas['keywords'] = "辽宁万维医药,辽宁,吉林省,黑龙江省,医药客户回馈";
$this->_metas['title'] = $this->_metas['title'] . "客户回馈";
}
示例11: Controller_Products
/**
* 构造函数
*
* @return Controller_Default
*/
function Controller_Products()
{
/**
* FLEA::getSingleton() 会自动载入指定类的定义文件,并且返回该类的唯一一个实例
*/
$this->_modelGoods =& FLEA::getSingleton('Model_Goods');
$this->_metas =& FLEA::getAppInf('metas');
$this->_metas['description'] = "辽宁万维医药经销渠道产品世界";
$this->_metas['keywords'] = "辽宁万维医药,辽宁,吉林省,黑龙江省,医药产品,思清,柴芩清宁胶囊";
$this->_metas['title'] = $this->_metas['title'] . "产品世界";
}
示例12: Controller_News
/**
* 构造函数
*
* @return Controller_Default
*/
function Controller_News()
{
/**
* FLEA::getSingleton() 会自动载入指定类的定义文件,并且返回该类的唯一一个实例
*/
$this->_modelNews =& FLEA::getSingleton('Model_News');
$this->_metas =& FLEA::getAppInf('metas');
$this->_metas['description'] = "辽宁万维医药有限公司新闻中心";
$this->_metas['keywords'] = "辽宁万维医药,辽宁,吉林省,黑龙江省,医药新闻";
$this->_metas['title'] = $this->_metas['title'] . "新闻中心";
}
示例13: Controller_Prem
function Controller_Prem()
{
$this->_M =& FLEA::getSingleton('Model_Prem');
$this->_V =& $this->_getView();
// 初始化消息对象
FLEA::loadClass("Util_Msg");
$this->_G = new Util_Msg();
// 写入CSS,IMG,JS目录
$this->_V->assign(FLEA::getAppInf("vdir"));
// 初始化导航
FLEA::loadClass("Util_Nav");
$this->_N = new Util_Nav();
}
示例14: checkLogin
function checkLogin()
{
if (!isset($this->_smarty)) {
$this->initView();
}
$rbac =& FLEA::getSingleton('FLEA_Rbac');
$user = $rbac->getUser();
if (!$user) {
redirect(url('login', 'index'));
} else {
$this->_smarty->assign('SE', $user);
}
}
示例15: actionindex
function actionindex()
{
//设置标题
$this->_title = '管理首页';
$rbac =& FLEA::getSingleton('FLEA_Rbac');
$user = $rbac->getUser();
//模板赋值
$this->_model =& FLEA::getSingleton('model_user');
$_user = $this->_model->find($user['UID']);
if (isset($_user)) {
$this->_smarty->assign('RepAct', explode(',', $_user['RepAct']));
$this->_smarty->assign('title', $this->_title);
$this->_smarty->display('main.htm');
}
}