예제 #1
0
파일: Mail.php 프로젝트: ashmna/MedDocs
 public static function syncDictionaryItem(\PHPMailer $mail, $keyName, $lang = '', array $params = [])
 {
     $app = App::getInstance();
     /** @var \MD\DAO\Dictionary $dictionaryDAO */
     $dictionaryDAO = $app->container->get('MD\\DAO\\Dictionary');
     $config = Config::getInstance();
     if (empty($lang)) {
         $lang = $config->currentLocale;
     }
     $params['name'] = $config->partnerName;
     $params['url'] = $config->getPartnerSiteUrl();
     $params['affiliateUrl'] = $config->partnerUrl;
     $params1 = [];
     foreach ($params as $key => $value) {
         $params1['{' . $key . '}'] = $value;
     }
     $params = $params1;
     $dictionary = $dictionaryDAO->getDictionaryItem($keyName, $lang);
     if (isset($dictionary)) {
         $mail->isHTML(true);
         $mail->Subject = strtr($dictionary->title, $params);
         $mail->Body = strtr($dictionary->content, $params);
     }
     return $mail;
 }
예제 #2
0
 private static function convertWorkingTimesToEvents(array $workingTimes)
 {
     $events = [];
     $color = Config::getInstance()->grtColor('workingTimes');
     foreach ($workingTimes as $date => $rows) {
         foreach ($rows as $row) {
             $events[] = ['start' => $date . ' ' . $row['startTime'], 'end' => $date . ' ' . $row['endTime'], 'rendering' => 'background', 'color' => $color];
         }
     }
     return $events;
 }
예제 #3
0
 /**
  * @param string $method
  * @param array $arguments
  * @return mixed
  * @throws SoapFaultException
  * @throws UndefinedMethodException
  */
 public static function send($method = '', $arguments = [])
 {
     if (!empty($method)) {
         try {
             $config = Config::getInstance();
             $soapClient = new \SoapClient($config->soapClientHost, $config->soapClientParams);
             return $soapClient->{$method}($arguments);
         } catch (\SoapFault $fault) {
             throw new SoapFaultException($fault);
         }
     } else {
         throw new UndefinedMethodException('Soap Method lost Dude :(');
     }
 }
예제 #4
0
파일: DB.php 프로젝트: ashmna/MedDocs
 public function __construct($host = null, $dbname = null, $dbuser = null, $dbpass = null)
 {
     $db = Config::getInstance()->db;
     if (!isset($host)) {
         $host = $db['host'];
         $dbname = $db['name'];
         $dbuser = $db['user'];
         $dbpass = $db['pass'];
     }
     $this->host = $host;
     $this->dbname = $dbname;
     $this->dbuser = $dbuser;
     $this->dbpass = $dbpass;
 }
예제 #5
0
 function updateOrderDates($orderId, \DateTime $start, \DateTime $end)
 {
     $data = ['start' => $start->format('Y-m-d H:i:s'), 'end' => $end->format('Y-m-d H:i:s')];
     $bind = ['partnerId' => Config::getInstance()->partnerId, 'orderId' => $orderId];
     return $this->db->update('orders', $data, 'partnerId = :partnerId AND orderId = :orderId', $bind);
 }
예제 #6
0
파일: index.php 프로젝트: ashmna/MedDocs
<?php

namespace {
    ini_set('memory_limit', '-1');
    ini_set('max_execution_time', 600);
    // 10m
    use MD\Helpers\App;
    use MD\Helpers\Config;
    use MD\Models\CronResult;
    require_once dirname(dirname(__DIR__)) . '/vendor/autoload.php';
    Config::init(dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME']))), ['useSession' => false]);
    //Config::init();
    $config = Config::getInstance();
    $app = App::getInstance();
    $cronResult = new CronResult();
    $cronResult->setPartnerId($config->partnerId);
    $cronResult->setStartDate(new \DateTime());
    $starMicroTime = microtime(true);
    $app->callCronFunction($cronResult, 'PaymentSystems');
    $app->callCronFunction($cronResult, 'Players');
    $app->callCronFunction($cronResult, 'PlayersActivityMain');
    $app->callCronFunction($cronResult, 'PlayersActivityCasino');
    $app->callCronFunction($cronResult, 'PlayersCasinoBonus');
    $app->callCronFunction($cronResult, 'PlayersExpenseMain');
    $app->callCronFunction($cronResult, 'BannerStat');
    $date = new \DateTime('-1 days');
    $date->setTime(10, 0, 0);
    $app->callCronFunction($cronResult, 'calculateCommission', 'MD\\Services\\CoreService', ['date' => $date], '');
    $executionTime = microtime(true) - $starMicroTime;
    $cronResult->setExecutionTime($executionTime);
    $app->call('MD\\DAO\\CronResult', 'saveCronResult', ['cronResult' => $cronResult]);
예제 #7
0
파일: index.php 프로젝트: ashmna/MedDocs
<?php

require_once dirname(dirname(__DIR__)) . '/vendor/autoload.php';
use MD\Helpers\Config;
use MD\Models\AjaxRequest;
ob_start();
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Methods: POST');
header('Access-Control-Allow-Headers: Content-Type');
if (!empty($_SERVER['HTTP_REFERER'])) {
    $parsedURL = parse_url($_SERVER['HTTP_REFERER']);
    $port = isset($parsedURL['port']) ? ':' . $parsedURL['port'] : '';
    header('Access-Control-Allow-Origin: ' . $parsedURL['scheme'] . '://' . $parsedURL['host'] . $port);
}
Config::init();
$ajaxResponse = AjaxRequest::getInstance()->getResponse();
$ajaxResponse->html = ob_get_contents();
ob_end_clean();
$ajaxResponse->printJSON();
예제 #8
0
파일: index.php 프로젝트: ashmna/MedDocs
<?php

use MD\Helpers\App;
use MD\Helpers\Config;
use MD\Helpers\Template;
require_once dirname(dirname(dirname(__DIR__))) . '/vendor/autoload.php';
Config::init(dirname(__DIR__));
App::redirectHandler();
Template::init();
예제 #9
0
파일: index.php 프로젝트: ashmna/MedDocs
<?php

use MD\Helpers\App;
use MD\Helpers\Config;
use MD\Helpers\Template;
require_once dirname(dirname(__DIR__)) . '/vendor/autoload.php';
Config::init(__DIR__, ['template' => 'front']);
App::redirectHandler();
Template::init();
예제 #10
0
파일: UserImpl.php 프로젝트: ashmna/MedDocs
 function deleteUserById($userId)
 {
     $bind = ['partnerId' => Config::getInstance()->partnerId, 'userId' => $userId];
     $user = $this->db->select('users', 'partnerId = :partnerId AND userId = :userId', $bind);
     if (count($user) == 1) {
         $user = $user[0];
         $userId = $user['userId'];
         switch ($user['role']) {
             case Defines::ROLE_DOCTOR:
                 $this->db->delete('doctors', 'doctorId = :userId', ['userId' => $userId]);
                 break;
             case Defines::ROLE_CLIENT:
                 $this->db->delete('clients', 'clientId = :userId', ['userId' => $userId]);
                 break;
         }
         return $this->db->delete('users', 'userId = :userId', ['userId' => $userId]);
     }
     return false;
 }
예제 #11
0
파일: header.php 프로젝트: ashmna/MedDocs
<head>
	<title><?php 
echo Config::getInstance()->partnerName;
?>
</title>

	<link rel="icon" href="/img/favicon.ico">

	<?php 
if (App::isLoggedUser()) {
    ?>
		<link rel="stylesheet" type="text/css" href="/style.css"/>
		<link rel="stylesheet" type="text/css" href="/global/css/datepicker/bootstrap-datepicker3.css">
		<link rel="stylesheet" type="text/css" href="/global/bower_components/jquery-ui/themes/start/jquery-ui.min.css">
		<?php 
    if (Config::getInstance()->environment == 'development') {
        ?>

		<?php 
    } else {
        ?>

		<?php 
    }
    ?>

		<!-- HTML5 shiv and Respond.js IE8 support of HTML5 elements and media queries -->
		<!--[if lt IE 9]>
		<script src="/global/js/html5shiv.js"></script>
		<script src="/global/js/respond.min.js"></script>
		<![endif]-->
예제 #12
0
파일: App.php 프로젝트: ashmna/MedDocs
 /**
  * @return bool
  * @throws \MD\Exceptions\ConfigurationException
  */
 public static function isLoggedUser()
 {
     $config = Config::getInstance();
     if ($config->test) {
         return true;
     }
     $session = self::getSession();
     return isset($session->isLogged) ? $session->isLogged : false;
 }
예제 #13
0
 public function deleteDayWorkingTimes($doctorId, \DateTime $date)
 {
     $bind = ['partnerId' => Config::getInstance()->partnerId, 'doctorId' => $doctorId, 'date' => $date->format('Y-m-d')];
     $where = 'partnerId = :partnerId AND doctorId = :doctorId AND date = :date';
     return $this->db->delete('workingTimes', $where, $bind);
 }
예제 #14
0
 public function getDefaultWorkingTimesForDay()
 {
     $workingTimes = Config::getInstance()->workingTimes;
     return $workingTimes['day'];
 }