本文整理汇总了PHP中BaseService类的典型用法代码示例。如果您正苦于以下问题:PHP BaseService类的具体用法?PHP BaseService怎么用?PHP BaseService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: showOptions
function showOptions($sql)
{
$service = new BaseService();
$results = $service->GetRows($sql);
$id = 0;
$i = 0;
foreach ($results as $row) {
if ($i == 0) {
$id = $row[0];
}
echo "<option value='" . $row[0] . "'>" . $row[1] . "</option>";
$i++;
}
return $id;
}
开发者ID:nikkiLuan,项目名称:PHP-Online-Order-System,代码行数:15,代码来源:Tool.inc.php
示例2: getInstance
public static function getInstance()
{
if (empty(self::$me)) {
self::$me = new BaseService();
}
return self::$me;
}
开发者ID:bravokeyl,项目名称:ems,代码行数:7,代码来源:BaseService.php
示例3: getEmployeeData
private function getEmployeeData($id, $obj)
{
$data = array();
$objs = $obj->Find("employee = ?", array($id));
foreach ($objs as $entry) {
$data[] = BaseService::getInstance()->cleanUpAdoDB($entry);
}
return $data;
}
开发者ID:ahmedalaahagag,项目名称:ICEPROHRM,代码行数:9,代码来源:EmployeesActionManager.php
示例4: includeModuleManager
function includeModuleManager($type,$name){
$moduleCapsName = ucfirst($name);
$moduleTypeCapsName = ucfirst($type); // Admin or Modules
$incFile = CLIENT_PATH.'/'.$type.'/'.$name.'/api/'.$moduleCapsName.$moduleTypeCapsName."Manager.php";
include ($incFile);
$moduleManagerClass = $moduleCapsName.$moduleTypeCapsName."Manager";
BaseService::getInstance()->addModuleManager(new $moduleManagerClass());
}
开发者ID:IrisDande,项目名称:icehrm,代码行数:9,代码来源:modules.php
示例5: addNotification
public function addNotification($toEmployee, $message, $action, $type, $toUserId = null, $fromSystem = false, $sendEmail = false)
{
$userEmp = new User();
if (!empty($toEmployee)) {
$userEmp->load("employee = ?", array($toEmployee));
if (!empty($userEmp->employee) && $userEmp->employee == $toEmployee) {
$toUser = $userEmp->id;
} else {
return;
}
} else {
if (!empty($toUserId)) {
$toUser = $toUserId;
}
}
$noti = new Notification();
if ($fromSystem) {
$noti->fromUser = 0;
$noti->fromEmployee = 0;
$noti->image = BASE_URL . "images/icehrm.png";
} else {
$user = $this->baseService->getCurrentUser();
$noti->fromUser = $user->id;
$noti->fromEmployee = $user->employee;
}
$noti->toUser = $toUser;
$noti->message = $message;
if (!empty($noti->fromEmployee) && $noti->fromEmployee != 0) {
$employee = $this->baseService->getElement('Employee', $noti->fromEmployee, null, true);
if (!empty($employee)) {
$employee = FileService::getInstance()->updateProfileImage($employee);
$noti->image = $employee->image;
}
}
if (empty($noti->image)) {
if ($employee->gender == 'Male') {
$noti->image = BASE_URL . "images/user_male.png";
} else {
$noti->image = BASE_URL . "images/user_female.png";
}
}
$noti->action = $action;
$noti->type = $type;
$noti->time = date('Y-m-d H:i:s');
$noti->status = 'Unread';
$ok = $noti->Save();
if (!$ok) {
error_log("Error adding notification: " . $noti->ErrorMsg());
} else {
if ($sendEmail) {
$emailSender = BaseService::getInstance()->getEmailSender();
if (!empty($emailSender)) {
$emailSender->sendEmailFromNotification($noti);
}
}
}
}
开发者ID:DevlJs,项目名称:icehrm,代码行数:57,代码来源:NotificationManager.php
示例6: setUp
protected function setUp()
{
parent::setUp();
include APP_BASE_PATH . "admin/users/api/UsersEmailSender.php";
include APP_BASE_PATH . "admin/users/api/UsersActionManager.php";
$this->obj = new UsersActionManager();
$this->obj->setUser($this->usersArray['admin']);
$this->obj->setBaseService(BaseService::getInstance());
$this->obj->setEmailSender(BaseService::getInstance()->getEmailSender());
}
开发者ID:rakesh-mohanta,项目名称:icehrm,代码行数:10,代码来源:UsersActionManagerTest.php
示例7: init
public function init()
{
if (SettingsManager::getInstance()->getSetting("Api: REST Api Enabled") == "1") {
$user = BaseService::getInstance()->getCurrentUser();
$dbUser = new User();
$dbUser->Load("id = ?", array($user->id));
$resp = RestApiManager::getInstance()->getAccessTokenForUser($dbUser);
if ($resp->getStatus() != IceResponse::SUCCESS) {
LogManager::getInstance()->error("Error occured while creating REST Api acces token for " . $user->username);
}
}
}
开发者ID:jpbalderas17,项目名称:hris,代码行数:12,代码来源:SettingsInitialize.php
示例8: includeModuleManager
function includeModuleManager($type, $name, $data)
{
$moduleCapsName = ucfirst($name);
$moduleTypeCapsName = ucfirst($type);
// Admin or Modules
$incFile = CLIENT_PATH . '/' . $type . '/' . $name . '/api/' . $moduleCapsName . $moduleTypeCapsName . "Manager.php";
include $incFile;
$moduleManagerClass = $moduleCapsName . $moduleTypeCapsName . "Manager";
$moduleManagerObj = new $moduleManagerClass();
$moduleManagerObj->setModuleObject($data);
$moduleManagerObj->setModuleType($type);
BaseService::getInstance()->addModuleManager($moduleManagerObj);
}
开发者ID:riazuddinahmed1,项目名称:icehrm,代码行数:13,代码来源:modules.php
示例9: execute
public function execute($cron)
{
$email = new IceEmail();
$emails = $email->Find("status = ? limit 10", array('Pending'));
$emailSender = BaseService::getInstance()->getEmailSender();
foreach ($emails as $email) {
try {
$emailSender->sendEmailFromDB($email);
} catch (Exception $e) {
LogManager::getInstance()->error("Error sending email:" . $e->getMessage());
}
$email->status = 'Sent';
$email->updated = date('Y-m-d H:i:s');
$email->Save();
}
}
开发者ID:DevlJs,项目名称:icehrm,代码行数:16,代码来源:common.cron.tasks.php
示例10: changeTimeSheetStatus
public function changeTimeSheetStatus($req)
{
$employee = $this->baseService->getElement('Employee', $this->getCurrentProfileId(), null, true);
$subordinate = new Employee();
$subordinates = $subordinate->Find("supervisor = ?", array($employee->id));
$subordinatesIds = array();
foreach ($subordinates as $sub) {
$subordinatesIds[] = $sub->id;
}
$timeSheet = new EmployeeTimeSheet();
$timeSheet->Load("id = ?", array($req->id));
if ($timeSheet->id != $req->id) {
return new IceResponse(IceResponse::ERROR, "Timesheet not found");
}
if ($req->status == 'Submitted' && $employee->id == $timeSheet->employee) {
} else {
if (!in_array($timeSheet->employee, $subordinatesIds) && $this->user->user_level != 'Admin') {
return new IceResponse(IceResponse::ERROR, "This Timesheet does not belong to any of your subordinates");
}
}
$oldStatus = $timeSheet->status;
$timeSheet->status = $req->status;
//Auto approve admin timesheets
if ($req->status == 'Submitted' && BaseService::getInstance()->getCurrentUser()->user_level == "Admin") {
$timeSheet->status = 'Approved';
}
if ($oldStatus == $req->status) {
return new IceResponse(IceResponse::SUCCESS, "");
}
$ok = $timeSheet->Save();
if (!$ok) {
LogManager::getInstance()->info($timeSheet->ErrorMsg());
}
$timeSheetEmployee = $this->baseService->getElement('Employee', $timeSheet->employee, null, true);
$this->baseService->audit(IceConstants::AUDIT_ACTION, "Timesheet [" . $timeSheetEmployee->first_name . " " . $timeSheetEmployee->last_name . " - " . date("M d, Y (l)", strtotime($timeSheet->date_start)) . " to " . date("M d, Y (l)", strtotime($timeSheet->date_end)) . "] status changed from:" . $oldStatus . " to:" . $req->status);
if ($timeSheet->status == "Submitted" && $employee->id == $timeSheet->employee) {
$notificationMsg = $employee->first_name . " " . $employee->last_name . " submitted timesheet from " . date("M d, Y (l)", strtotime($timeSheet->date_start)) . " to " . date("M d, Y (l)", strtotime($timeSheet->date_end));
$this->baseService->notificationManager->addNotification($employee->supervisor, $notificationMsg, '{"type":"url","url":"g=modules&n=time_sheets&m=module_Time_Management#tabSubEmployeeTimeSheetAll"}', IceConstants::NOTIFICATION_TIMESHEET);
} else {
if ($timeSheet->status == "Approved" || $timeSheet->status == "Rejected") {
$notificationMsg = $employee->first_name . " " . $employee->last_name . " " . $timeSheet->status . " timesheet from " . date("M d, Y (l)", strtotime($timeSheet->date_start)) . " to " . date("M d, Y (l)", strtotime($timeSheet->date_end));
$this->baseService->notificationManager->addNotification($timeSheet->employee, $notificationMsg, '{"type":"url","url":"g=modules&n=time_sheets&m=module_Time_Management#tabEmployeeTimeSheetApproved"}', IceConstants::NOTIFICATION_TIMESHEET);
}
}
return new IceResponse(IceResponse::SUCCESS, "");
}
开发者ID:riazuddinahmed1,项目名称:icehrm,代码行数:46,代码来源:Time_sheetsActionManager.php
示例11: getUserLeaveTypes
public function getUserLeaveTypes()
{
$ele = new LeaveType();
$empLeaveGroupId = NULL;
$employeeId = BaseService::getInstance()->getCurrentProfileId();
$empLeaveGroup = new LeaveGroupEmployee();
$empLeaveGroup->Load("employee = ?", array($employeeId));
if ($empLeaveGroup->employee == $employeeId && !empty($empLeaveGroup->id)) {
$empLeaveGroupId = $empLeaveGroup->leave_group;
}
if (empty($empLeaveGroupId)) {
$list = $ele->Find('leave_group IS NULL', array());
} else {
$list = $ele->Find('leave_group IS NULL or leave_group = ?', array($empLeaveGroupId));
}
return $list;
}
开发者ID:ahmedalaahagag,项目名称:ICEPROHRM,代码行数:17,代码来源:LeavesAdminManager.php
示例12: getLastTimeSheetHours
private function getLastTimeSheetHours()
{
$timeSheet = new EmployeeTimeSheet();
$timeSheet->Load("employee = ? order by date_end desc limit 1", array(BaseService::getInstance()->getCurrentProfileId()));
if (empty($timeSheet->employee)) {
return new IceResponse(IceResponse::SUCCESS, "0:00");
}
$timeSheetEntry = new EmployeeTimeEntry();
$list = $timeSheetEntry->Find("timesheet = ?", array($timeSheet->id));
$seconds = 0;
foreach ($list as $entry) {
$seconds += strtotime($entry->date_end) - strtotime($entry->date_start);
}
$minutes = (int) ($seconds / 60);
$rem = $minutes % 60;
$hours = ($minutes - $rem) / 60;
if ($rem < 10) {
$rem = "0" . $rem;
}
return new IceResponse(IceResponse::SUCCESS, $hours . ":" . $rem);
}
开发者ID:riazuddinahmed1,项目名称:icehrm,代码行数:21,代码来源:Time_sheetsModulesManager.php
示例13: ucfirst
include CLIENT_PATH . "/server.includes.inc.php";
$user = SessionUtils::getSessionObject('user');
$profileCurrent = null;
$profileSwitched = null;
$profileClass = ucfirst(SIGN_IN_ELEMENT_MAPPING_FIELD_NAME);
$profileVar = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
if (!empty($user->{$profileVar})) {
$profileCurrent = BaseService::getInstance()->getElement($profileClass, $user->{$profileVar}, null, true);
if (!empty($profileCurrent)) {
$profileCurrent = FileService::getInstance()->updateProfileImage($profileCurrent);
}
}
if ($user->user_level == 'Admin' || $user->user_level == 'Manager') {
$switchedEmpId = BaseService::getInstance()->getCurrentProfileId();
if ($switchedEmpId != $user->{$profileVar} && !empty($switchedEmpId)) {
$profileSwitched = BaseService::getInstance()->getElement($profileClass, $switchedEmpId, null, true);
if (!empty($profileSwitched)) {
$profileSwitched = FileService::getInstance()->updateProfileImage($profileSwitched);
}
}
}
$activeProfile = null;
if (!empty($profileSwitched)) {
$activeProfile = $profileSwitched;
} else {
$activeProfile = $profileCurrent;
}
//read field templates
$fieldTemplates = array();
$fieldTemplates['hidden'] = file_get_contents(CLIENT_PATH . '/templates/fields/hidden.html');
$fieldTemplates['text'] = file_get_contents(CLIENT_PATH . '/templates/fields/text.html');
开发者ID:bravokeyl,项目名称:ems,代码行数:31,代码来源:includes.inc.php
示例14: getQuickAccessMenuItemsHTML
public function getQuickAccessMenuItemsHTML()
{
$html = "";
$user = BaseService::getInstance()->getCurrentUser();
foreach ($this->quickAccessMenuItems as $item) {
if (empty($item[3]) || in_array($user->user_level, $item[3])) {
$html .= '<a href="' . $item[2] . '"><i class="fa ' . $item[1] . '"></i> ' . $item[0] . '</a>';
}
}
return $html;
}
开发者ID:ahmedalaahagag,项目名称:ICEPROHRM,代码行数:11,代码来源:UIManager.php
示例15: Date
echo BASE_URL;
?>
js/app-global.js"></script>
</head>
<body class="skin-blue">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '<?php
echo BaseService::getInstance()->getGAKey();
?>
', 'gamonoid.com');
ga('send', 'pageview');
</script>
<script type="text/javascript">
</script>
<header id="delegationDiv" class="header">
<a href="<?php
echo $homeLink;
?>
" class="logo" style="font-family: 'Source Sans Pro', sans-serif;">
开发者ID:woppywush,项目名称:icehrm,代码行数:31,代码来源:header.php
示例16: updateCampaign
/**
* Update a specific email campaign
* @param string $accessToken - Constant Contact OAuth2 access token
* @param Campaign $campaign - Campaign to be updated
* @return Campaign
*/
public function updateCampaign($accessToken, Campaign $campaign)
{
$baseUrl = Configs::get('endpoints.base_url') . sprintf(Configs::get('endpoints.campaign'), $campaign->id);
$url = $this->buildUrl($baseUrl);
$response = parent::getRestClient()->put($url, parent::getHeaders($accessToken), $campaign->toJson());
return Campaign::create(json_decode($response->body, true));
}
开发者ID:CreatrixeNew,项目名称:carparking,代码行数:13,代码来源:EmailMarketingService.php
示例17: __construct
public function __construct()
{
parent::__construct();
$this->load->model('catalog/product');
$this->load->model('tool/image');
$this->language->load('product/product');
}
开发者ID:jemmy655,项目名称:OpenCart-API-service-by-Kancart.com-Mobile,代码行数:7,代码来源:ProductTranslatorService.php
示例18: init
function init(&$server)
{
parent::init($server);
$server->wsdl->addComplexType('Version', 'complexType', 'struct', 'all', '', array('shopver' => array('name' => 'shopver', 'type' => 'xsd:string'), 'assisver' => array('name' => 'assisver', 'type' => 'xsd:string')));
$server->register('GetVersion', array(), array('return' => 'tns:Version'), 'urn:shopexapi', 'urn:shopexapi#GetVersion', 'rpc', 'encoded', '');
$server->register('Login', array('user' => 'xsd:string', 'pass' => 'xsd:string', 'loginas' => 'xsd:int'), array('return' => 'xsd:boolean'), 'urn:shopexapi', 'urn:shopexapi#Login', 'rpc', 'encoded', '');
$server->register('GetRedirectToken', array('user' => 'xsd:string', 'pass' => 'xsd:string', 'loginas' => 'xsd:int'), array('return' => 'xsd:string'), 'urn:shopexapi', 'urn:shopexapi#GetRedirectToken', 'rpc', 'encoded', '');
}
开发者ID:noikiy,项目名称:MyShop,代码行数:8,代码来源:service.Login.php
示例19: init
function init(&$server)
{
parent::init($server);
$server->register('GetFileSize', array('baseType' => 'xsd:int', 'filename' => 'xsd:string'), array('return' => 'xsd:int'), 'urn:shopexapi', 'urn:shopexapi#GetFileSize', 'rpc', 'encoded', '');
$server->register('DownloadFile', array('baseType' => 'xsd:int', 'filename' => 'xsd:string'), array(), 'urn:shopexapi', 'urn:shopexapi#DownloadFile', 'rpc', 'encoded', '');
$server->register('UploadFile', array('baseType' => 'xsd:int', 'filename' => 'xsd:string', 'append' => 'xsd:boolean'), array(), 'urn:shopexapi', 'urn:shopexapi#UploadFile', 'rpc', 'encoded', '');
$server->register('UploadGoodsImage', array('goods_id' => 'xsd:int', 'gimage_ids' => 'tns:IntegerArray'), array(), 'urn:shopexapi', 'urn:shopexapi#UploadGoodsImage', 'rpc', 'encoded', '');
}
开发者ID:noikiy,项目名称:MyShop,代码行数:8,代码来源:service.SyncFile.php
示例20: __construct
public function __construct()
{
parent::__construct();
// Ezmlm lib
$this->lib = new Ezmlm();
// additional settings
$this->defaultMessagesLimit = $this->config['settings']['defaultMessagesLimit'];
$this->defaultThreadsLimit = $this->config['settings']['defaultThreadsLimit'];
}
开发者ID:kstefanini,项目名称:ezmlm-php,代码行数:9,代码来源:EzmlmService.php
注:本文中的BaseService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论