当前位置: 首页>>代码示例>>PHP>>正文


PHP BaseService类代码示例

本文整理汇总了PHP中BaseService的典型用法代码示例。如果您正苦于以下问题:PHP BaseService类的具体用法?PHP BaseService怎么用?PHP BaseService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了BaseService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例12: __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

示例13: 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

示例14: 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

示例15: __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;未经允许,请勿转载。