コード例 #1
0
ファイル: ExceptionHandler.php プロジェクト: Trideon/gigolo
 public static function Handle($exception)
 {
     Log::Error('Uncaught exception: %s', $exception);
     if (isset(self::$handler)) {
         self::$handler->HandleException($exception);
     }
 }
コード例 #2
0
 /**
  * 简单的自定义处理handler的方法handlerIndex
  * 可以不用exceptionHandler类下处理,但前提你你知道自己在做什么
  * @param type $e  
  */
 static function handlerIndex($e)
 {
     $excepHandler = new ExceptionHandler();
     $excepHandler->out['_url'][] = array('url' => '/', 'text' => '返回首页');
     $excepHandler->out['_url'][] = array('url' => '/', 'text' => '返回上页');
     $excepHandler->tpl = PATH_APP . '/template/index_msg.tpl';
     $excepHandler->handler($e);
 }
コード例 #3
0
ファイル: shift.class.php プロジェクト: jafarkhani/rtfund
 function DatesAreValid()
 {
     $dt = PdoDataAccess::runquery("select * from ATN_PersonShifts\r\n\t\t\twhere PersonID=:p \r\n\t\t\tAND ( :f between FromDate AND ToDate OR :t between FromDate AND ToDate ) AND RowID <> :r", array(":p" => $this->PersonID, ":r" => $this->RowID, ":f" => DateModules::shamsi_to_miladi($this->FromDate, "-"), ":t" => DateModules::shamsi_to_miladi($this->ToDate, "-")));
     if (count($dt) > 0) {
         ExceptionHandler::PushException("شیفت انتخاب شده دارای تداخل زمانی میباشد");
         return false;
     }
     /*$ShiftObj = new ATN_shifts($this->ShiftID);
     		
     		$dt = PdoDataAccess::runquery("select * from ATN_PersonShifts join ATN_shifts using(ShiftID)
     			where PersonID=:p 
     			AND ( (:s between FromTime AND ToTime) OR (:e between FromTime AND ToTime) ) AND RowID <> :r 
     			AND ( (:f between FromDate AND if(ToDate='0000-00-00','4000-00-00',ToDate) ) 
     				OR (:t between FromDate AND if(ToDate='0000-00-00','4000-00-00',ToDate) ) )", 
     			array(":p" => $this->PersonID, ":s" => $ShiftObj->FromTime, 
     				  ":e" => $ShiftObj->ToTime, ":r" => $this->RowID,
     				  ":f" => DateModules::shamsi_to_miladi($this->FromDate), 
     				  ":t" => DateModules::shamsi_to_miladi($this->ToDate)));
     
     		if(count($dt) > 0)
     		{
     			ExceptionHandler::PushException("شیفت های این فرد با یکدیگر دارای تداخل ساعتی می باشند");;
     			return false;
     		}		*/
     return true;
 }
コード例 #4
0
ファイル: templates.data.php プロジェクト: jafarkhani/rtfund
function SaveTemplate()
{
    $pdo = PdoDataAccess::getPdoObject();
    $pdo->beginTransaction();
    $CorrectContent = CNT_templates::CorrectTemplateContentItems($_POST['TemplateContent']);
    $obj = new CNT_templates();
    $obj->TemplateContent = $CorrectContent;
    $obj->TemplateTitle = $_POST['TemplateTitle'];
    if ($_POST['TemplateID'] > 0) {
        $obj->TemplateID = $_POST['TemplateID'];
        $result = $obj->Edit($pdo);
    } else {
        $result = $obj->Add($pdo);
    }
    if (!$result) {
        $pdo->rollBack();
        print_r(ExceptionHandler::PopAllExceptions());
        //echo PdoDataAccess::GetLatestQueryString();
        echo Response::createObjectiveResponse(false, ExceptionHandler::GetExceptionsToString());
        die;
    }
    $pdo->commit();
    echo Response::createObjectiveResponse(true, $obj->TemplateID);
    die;
}
コード例 #5
0
ファイル: PostFoldedResources.php プロジェクト: ilivanoff/www
 public function getFoldedEntityPreview($ident)
 {
     $type = $this->pp->getPostType();
     $postCP = $this->pp->getPostContentProviderByIdent($ident);
     $hasInDb = is_object($postCP);
     $post = null;
     if ($hasInDb) {
         $post = $postCP->getPost();
     } else {
         //Сделаем его форсированно загружаемым из шаблона
         $virtualPostParams['b_tpl'] = 1;
         $post = $this->pp->getVirtualPost($ident, $virtualPostParams);
         $postCP = ContentProviderFactory::getContentProvider($post);
     }
     //Накачиваем страницу
     $PARAMS = array('type' => $type, 'full' => '', 'short' => '', 'error' => '');
     try {
         $PARAMS['full'] = $postCP->getPostContent()->getContent();
         $PARAMS['short'] = $postCP->getPostContentShowcase()->getContent();
     } catch (Exception $ex) {
         $PARAMS['error'] = ExceptionHandler::getHtml($ex);
     }
     $info = $hasInDb ? $this->pp->postHref($post, null, null, null, true) : PsHtml::gray($post->isVirtual() ? 'Пост не зарегистрирован в базе' : 'Пост зарегистрирован в базе, но не виден пользователю');
     $content = PSSmarty::template('post/folded_prev.tpl', $PARAMS)->fetch();
     return array('info' => $info, 'content' => $content);
 }
コード例 #6
0
function deleteParam()
{
    $obj = new manage_salary_params();
    $obj->param_id = $_POST["param_id"];
    echo $obj->RemoveParam($obj->param_id) ? "true" : ExceptionHandler::GetExceptionsToString("\n");
    die;
}
コード例 #7
0
ファイル: writ_item.data.php プロジェクト: jafarkhani/rtfund
function DontPayItem()
{
    $obj = new manage_writ_item();
    $return = $obj->DontPayItems($_POST["writ_id"], $_POST["writ_ver"], $_POST["staff_id"]);
    echo Response::createObjectiveResponse($return, $return ? $obj->writ_id : ExceptionHandler::popExceptionDescription());
    die;
}
コード例 #8
0
ファイル: PSDB.php プロジェクト: ilivanoff/www
 /** @return ADORecordSet */
 private static function executeQuery($query, $params = false, &$queryFinal = null, array &$paramsFinal = null)
 {
     $queryFinal = $query instanceof Query ? $query->build($params) : $query;
     $queryFinal = normalize_string($queryFinal);
     $paramsFinal = to_array($params);
     $LOGGER = PsLogger::inst(__CLASS__);
     $PROFILER = PsProfiler::inst(__CLASS__);
     $PROFILER->start(strtolower($queryFinal));
     try {
         if ($LOGGER->isEnabled()) {
             $LOGGER->info("[{$queryFinal}]" . ($paramsFinal ? ', PARAMS: ' . array_to_string($paramsFinal) : ''));
         }
         $rs = PsConnectionPool::conn()->execute($queryFinal, $paramsFinal);
         if (is_object($rs)) {
             $PROFILER->stop();
             return $rs;
         }
         $error = PsConnectionPool::conn()->ErrorMsg();
         $LOGGER->info('ERROR: {}', $error);
         throw new DBException($error, DBException::ERROR_NOT_CLASSIFIED, $queryFinal, $paramsFinal);
     } catch (Exception $ex) {
         $PROFILER->stop(false);
         if ($ex instanceof DBException) {
             ExceptionHandler::dumpError($ex);
         }
         throw $ex;
     }
 }
コード例 #9
0
ファイル: Base.class.php プロジェクト: raptorphp/raptorphp
 static function load($className)
 {
     if (count(split('/', $className)) >= 2) {
         $sep = split('/', $className);
         if (count($sep) == 2) {
             $appName = $sep[0];
             $conName = $sep[1];
             $action = "index";
         } else {
             $appName = $sep[1];
             $conName = $sep[2];
             if (isset($sep[3])) {
                 $action = $sep[3];
             }
         }
         if (empty($action)) {
             $action = "index";
         }
         if (empty($appName)) {
             ExceptionHandler::ErrorStr("Application request: {$conName}");
         }
         $fileName = $_ENV['raptorphp.dir_apps'] . $appName . '/controllers/' . $conName . '.php';
         if (file_exists($fileName)) {
             require_once $fileName;
             $ControllerName = ucfirst($appName);
             $Controller = new $ControllerName();
             $Controller->{$action}();
         } else {
             ExceptionHandler::ErrorStr("Controller request: {$className} is missing.");
         }
     } else {
         ExceptionHandler::ErrorStr("Controller request: {$className} is missing.");
     }
 }
コード例 #10
0
 public static function handleException(Exception $e)
 {
     self::$_exception = $e;
     require_once 'Pages/ExceptionsPage.php';
     $ep = new ExceptionsPage();
     return $ep->index($e);
 }
コード例 #11
0
 public function getFoldedEntityPreview($ident)
 {
     $type = $this->rp->getPostType();
     $rubricCP = $this->rp->getRubricContentProviderByIdent($ident);
     $hasInDb = is_object($rubricCP);
     $rubric = null;
     if ($hasInDb) {
         $rubric = $rubricCP->getRubric();
     } else {
         //Сделаем его форсированно загружаемым из шаблона
         $virtualRubricParams['b_tpl'] = 1;
         $rubric = $this->rp->getVirtualRubric($ident, $virtualRubricParams);
         $rubricCP = ContentProviderFactory::getContentProvider($rubric);
     }
     //Накачиваем страницу
     $PARAMS = array('type' => $type, 'full' => '', 'error' => '');
     try {
         $PARAMS['full'] = $rubricCP->getContent();
     } catch (Exception $ex) {
         $PARAMS['error'] = ExceptionHandler::getHtml($ex);
     }
     $info = $hasInDb ? $this->rp->rubricHref($rubric) : PsHtml::gray($rubric->isVirtual() ? 'Рубрика не зарегистрирована в базе' : 'Рубрика зарегистрирована в базе, но не видна пользователю');
     $content = PSSmarty::template('rubric/folded_prev.tpl', $PARAMS)->fetch();
     return array('info' => $info, 'content' => $content);
 }
コード例 #12
0
ファイル: Debug.php プロジェクト: Ener-Getick/symfony
 /**
  * Enables the debug tools.
  *
  * This method registers an error handler and an exception handler.
  *
  * If the Symfony ClassLoader component is available, a special
  * class loader is also registered.
  *
  * @param int  $errorReportingLevel The level of error reporting you want
  * @param bool $displayErrors       Whether to display errors (for development) or just log them (for production)
  */
 public static function enable($errorReportingLevel = E_ALL, $displayErrors = true)
 {
     if (static::$enabled) {
         return;
     }
     static::$enabled = true;
     if (null !== $errorReportingLevel) {
         error_reporting($errorReportingLevel);
     } else {
         error_reporting(E_ALL);
     }
     if ('cli' !== PHP_SAPI) {
         ini_set('display_errors', 0);
         ExceptionHandler::register();
     } elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) {
         // CLI - display errors only if they're not already logged to STDERR
         ini_set('display_errors', 1);
     }
     if ($displayErrors) {
         ErrorHandler::register(new ErrorHandler(new BufferingLogger()));
     } else {
         ErrorHandler::register()->throwAt(0, true);
     }
     DebugClassLoader::enable();
 }
コード例 #13
0
ファイル: ContentHelper.php プロジェクト: ilivanoff/www
 /**
  * Метод безопасно получает контент.
  * В случае возникновения ошибки возвращает её стек.
  */
 public static function getContent($objOrTpl, $method = 'buildContent')
 {
     $isCallable = is_callable($objOrTpl);
     $isTpl = $objOrTpl instanceof Smarty_Internal_Template;
     if (!$isCallable && !$isTpl) {
         check_condition(is_object($objOrTpl), 'Not object passed to ' . __FUNCTION__);
         PsUtil::assertMethodExists($objOrTpl, $method);
     }
     $returned = null;
     $flushed = null;
     ob_start();
     ob_implicit_flush(false);
     try {
         if ($isCallable) {
             $returned = call_user_func($objOrTpl);
         } else {
             if ($isTpl) {
                 $returned = $objOrTpl->fetch();
             } else {
                 $returned = $objOrTpl->{$method}();
             }
         }
     } catch (Exception $ex) {
         ob_end_clean();
         return ExceptionHandler::getHtml($ex);
     }
     $flushed = ob_get_contents();
     ob_end_clean();
     return isEmpty($returned) ? isEmpty($flushed) ? null : $flushed : $returned;
 }
コード例 #14
0
ファイル: staff.data.php プロジェクト: jafarkhani/rtfund
function saveStaffData()
{
    $obj = new manage_staff();
    PdoDataAccess::FillObjectByArray($obj, $_POST);
    if (isset($_POST["work_start_date"])) {
        $obj->work_start_date = DateModules::Shamsi_to_Miladi($_POST["work_start_date"]);
    }
    if (isset($_POST["ProfWorkStart"])) {
        $obj->ProfWorkStart = DateModules::Shamsi_to_Miladi($_POST["ProfWorkStart"]);
    }
    if (isset($_POST["retired_date"])) {
        $obj->retired_date = DateModules::Shamsi_to_Miladi($_POST["retired_date"]);
    }
    if (isset($_POST["last_retired_pay"])) {
        $obj->last_retired_pay = DateModules::Shamsi_to_Miladi($_POST["last_retired_pay"]);
    }
    if (!isset($_POST['Over25'])) {
        $obj->Over25 = 0;
    }
    $obj->sum_paied_pension = $obj->sum_paied_pension > 0 ? $obj->sum_paied_pension : "0";
    $return = $obj->EditStaff();
    $key = $obj->staff_id . "," . $obj->PersonID . "," . $obj->person_type;
    echo $return ? Response::createObjectiveResponse("true", $key) : Response::createObjectiveResponse(false, ExceptionHandler::GetExceptionsToString("\n"));
    die;
}
コード例 #15
0
ファイル: Page.php プロジェクト: ViraSoftware/booked
 protected function __construct($titleKey = '', $pageDepth = 0)
 {
     $this->SetSecurityHeaders();
     $this->path = str_repeat('../', $pageDepth);
     $this->server = ServiceLocator::GetServer();
     $resources = Resources::GetInstance();
     ExceptionHandler::SetExceptionHandler(new WebExceptionHandler(array($this, 'RedirectToError')));
     $this->smarty = new SmartyPage($resources, $this->path);
     $userSession = ServiceLocator::GetServer()->GetUserSession();
     $this->smarty->assign('Charset', $resources->Charset);
     $this->smarty->assign('CurrentLanguage', $resources->CurrentLanguage);
     $this->smarty->assign('HtmlLang', $resources->HtmlLang);
     $this->smarty->assign('HtmlTextDirection', $resources->TextDirection);
     $appTitle = Configuration::Instance()->GetKey(ConfigKeys::APP_TITLE);
     $pageTile = $resources->GetString($titleKey);
     $this->smarty->assign('Title', (empty($appTitle) ? 'Booked' : $appTitle) . (empty($pageTile) ? '' : ' - ' . $pageTile));
     $this->smarty->assign('CalendarJSFile', $resources->CalendarLanguageFile);
     $this->smarty->assign('LoggedIn', $userSession->IsLoggedIn());
     $this->smarty->assign('Version', Configuration::VERSION);
     $this->smarty->assign('Path', $this->path);
     $this->smarty->assign('ScriptUrl', Configuration::Instance()->GetScriptUrl());
     $this->smarty->assign('UserName', !is_null($userSession) ? $userSession->FirstName : '');
     $this->smarty->assign('DisplayWelcome', $this->DisplayWelcome());
     $this->smarty->assign('UserId', $userSession->UserId);
     $this->smarty->assign('CanViewAdmin', $userSession->IsAdmin);
     $this->smarty->assign('CanViewGroupAdmin', $userSession->IsGroupAdmin);
     $this->smarty->assign('CanViewResourceAdmin', $userSession->IsResourceAdmin);
     $this->smarty->assign('CanViewScheduleAdmin', $userSession->IsScheduleAdmin);
     $this->smarty->assign('CanViewResponsibilities', !$userSession->IsAdmin && ($userSession->IsGroupAdmin || $userSession->IsResourceAdmin || $userSession->IsScheduleAdmin));
     $allowAllUsersToReports = Configuration::Instance()->GetSectionKey(ConfigSection::REPORTS, ConfigKeys::REPORTS_ALLOW_ALL, new BooleanConverter());
     $this->smarty->assign('CanViewReports', $allowAllUsersToReports || $userSession->IsAdmin || $userSession->IsGroupAdmin || $userSession->IsResourceAdmin || $userSession->IsScheduleAdmin);
     $timeout = Configuration::Instance()->GetKey(ConfigKeys::INACTIVITY_TIMEOUT);
     if (!empty($timeout)) {
         $this->smarty->assign('SessionTimeoutSeconds', max($timeout, 1) * 60);
     }
     $this->smarty->assign('ShouldLogout', $this->GetShouldAutoLogout());
     $this->smarty->assign('CssExtensionFile', Configuration::Instance()->GetKey(ConfigKeys::CSS_EXTENSION_FILE));
     $this->smarty->assign('UseLocalJquery', Configuration::Instance()->GetKey(ConfigKeys::USE_LOCAL_JQUERY, new BooleanConverter()));
     $this->smarty->assign('EnableConfigurationPage', Configuration::Instance()->GetSectionKey(ConfigSection::PAGES, ConfigKeys::PAGES_ENABLE_CONFIGURATION, new BooleanConverter()));
     $this->smarty->assign('ShowParticipation', !Configuration::Instance()->GetSectionKey(ConfigSection::RESERVATION, ConfigKeys::RESERVATION_PREVENT_PARTICIPATION, new BooleanConverter()));
     $this->smarty->assign('LogoUrl', 'booked.png');
     if (file_exists($this->path . 'img/custom-logo.png')) {
         $this->smarty->assign('LogoUrl', 'custom-logo.png');
     }
     if (file_exists($this->path . 'img/custom-logo.gif')) {
         $this->smarty->assign('LogoUrl', 'custom-logo.gif');
     }
     if (file_exists($this->path . 'img/custom-logo.jpg')) {
         $this->smarty->assign('LogoUrl', 'custom-logo.jpg');
     }
     $this->smarty->assign('CssUrl', 'null-style.css');
     if (file_exists($this->path . 'css/custom-style.css')) {
         $this->smarty->assign('CssUrl', 'custom-style.css');
     }
     $logoUrl = Configuration::Instance()->GetKey(ConfigKeys::HOME_URL);
     if (empty($logoUrl)) {
         $logoUrl = $this->path . Pages::UrlFromId($userSession->HomepageId);
     }
     $this->smarty->assign('HomeUrl', $logoUrl);
 }
コード例 #16
0
ファイル: exe_posts.class.php プロジェクト: jafarkhani/rtfund
 function release_post()
 {
     $temp = parent::runquery("SELECT s.staff_id, s.post_id\r\n    \t\tFROM position p INNER JOIN staff s ON(s.staff_id = p.staff_id)\r\n    \t\tWHERE p.post_id = ? AND s.staff_id=?", array($this->post_id, $this->staff_id));
     if (count($temp) == 0) {
         return true;
     }
     if ($temp[0]["post_id"] == $this->post_id) {
         ExceptionHandler::PushException(CANNT_RELEASE_WRIT_POST);
         return false;
     }
     parent::runquery("update position set staff_id=null where post_id=" . $this->post_id);
     $daObj = new DataAudit();
     $daObj->ActionType = DataAudit::Action_update;
     $daObj->RelatedPersonType = DataAudit::PersonType_staff;
     $daObj->RelatedPersonID = $this->staff_id;
     $daObj->MainObjectID = $this->post_id;
     $daObj->TableName = "position";
     $daObj->description = "آزاد کردن پست اجرایی هیئت علمی";
     $daObj->execute();
     //------------------ baseinfo update ---------------------------
     $staffObj = new manage_staff("", "", $this->staff_id);
     require_once inc_manage_post;
     manage_posts::baseinfoRelease($staffObj->PersonID, $this->post_id, "آزاد کردن پست اجرایی هیئت علمی");
     //--------------------------------------------------------------
     return true;
 }
コード例 #17
0
 public static function &getInstance()
 {
     if (self::$_instance === null) {
         self::$_instance = new ExceptionHandler();
     }
     return self::$_instance;
 }
コード例 #18
0
ファイル: BaseClientBox.php プロジェクト: ilivanoff/www
 /**
  * Метод получает фактический контект для всплывающей страницы.
  * Сама страница может вернуть или IdentPageFilling, и тогда содержимое 
  * будет обработано за неё. Или непосредственно IdentPageContent,
  * если ей самой нужно обработать содержимое (например - акции).
  * 
  * @return ClientBoxContent
  */
 public final function getContent()
 {
     if ($this->cbContent) {
         return $this->cbContent;
     }
     $this->checkAccess();
     $this->profilerStart(__FUNCTION__);
     $filling = null;
     try {
         $filling = $this->getClientBoxFilling();
         check_condition($filling instanceof ClientBoxFilling, "Элемент [{$this->ident}] обработан некорректно");
     } catch (Exception $ex) {
         $this->profilerStop(false);
         return $this->cbContent = new ClientBoxContent(PsHtml::divErr(ExceptionHandler::getHtml($ex)));
     }
     //Построим заголовок
     $HEAD_PARAMS['class'][] = 'box-header';
     if ($filling->isCover()) {
         $HEAD_PARAMS['class'][] = 'covered';
         $HEAD_PARAMS['style']['background-image'] = 'url(' . $this->foldedEntity->getCover()->getRelPath() . ')';
     }
     $HEAD_CONTENT = $filling->getHref() ? PsHtml::a(array('href' => $filling->getHref()), $filling->getTitle()) : $filling->getTitle();
     $HEAD = PsHtml::html2('h3', $HEAD_PARAMS, $HEAD_CONTENT);
     $BOX_CONTENT = $this->foldedEntity->fetchTplWithResources($filling->getSmartyParams());
     $BOX = PsHtml::div(array(), $HEAD . $BOX_CONTENT);
     $this->profilerStop();
     return $this->cbContent = new ClientBoxContent($BOX, $filling->getJsParams());
 }
コード例 #19
0
ファイル: change_pass.php プロジェクト: jafarkhani/rtfund
function changePass()
{
    require_once '../../../header.inc.php';
    require_once inc_response;
    require_once inc_dataReader;
    $pdoAcc = PdoDataAccess::getPdoObject(config::$db_servers['master']["host"], config::$db_servers['master']["framework_user"], config::$db_servers['master']["framework_pass"], "framework");
    $dt = PdoDataAccess::runquery("select * from AccountSpecs \n\t\t\t\t\t\t\t\t\t\twhere personID=:psid", array(":psid" => $_SESSION['PersonID']), $pdoAcc);
    if (count($dt) == 0) {
        echo "false";
        die;
    }
    $password = md5($_POST["cur_pass"]);
    $stored_seed = substr($dt[0]["pswd1"], 40, 10);
    if (sha1($stored_seed . $password . $stored_seed) . $stored_seed != $dt[0]["pswd1"]) {
        echo "CurPassError";
        die;
    }
    $seed = '';
    $password2 = md5($_POST["new_pass"]);
    for ($i = 1; $i <= 10; $i++) {
        $seed .= substr('0123456789abcdef', rand(0, 15), 1);
    }
    PdoDataAccess::RUNQUERY("update AccountSpecs set pswd1=:pswd where personID=:psid", array(":pswd" => sha1($seed . $password2 . $seed) . $seed, ":psid" => $_SESSION['PersonID']), $pdoAcc);
    if (ExceptionHandler::GetExceptionCount() != 0) {
        echo "CurPassError";
        die;
    }
    //PdoDataAccess::AUDIT("AccountSpecs","تغییر رمز عبور", "");
    echo "true";
    die;
}
コード例 #20
0
ファイル: contract.class.php プロジェクト: jafarkhani/rtfund
 public function Remove()
 {
     if (!DMS_documents::DeleteAllDocument($this->ContractID, "contract")) {
         ExceptionHandler::PushException("خطا در حذف مدارک");
         return false;
     }
     return parent::Remove();
 }
コード例 #21
0
 function make_success_row($person_rec)
 {
     if (ExceptionHandler::GetExceptionCount() == 0) {
         $this->s_count++;
         fwrite($this->s_content, "\r\n\t\t\t<tr style='font-family:tahoma;font-size:11px;font-weight:bold;color:#1A58A6;border-bottom:solid 1px #1A58A6;'>\r\n\t            <td height=21px>شماره شناسايي :{$person_rec['staff_id']}</td>\r\n\t            <td>نام : {$person_rec['pfname']}</td>\r\n\t            <td>نام خانوادگي : {$person_rec['plname']}</td>\r\n\t            <td>شماره حکم : {$person_rec['writ_id']}</td>\r\n\t            </tr>");
     } else {
         self::make_unsuccess_rows($person_rec);
     }
 }
コード例 #22
0
ファイル: cheque.class.php プロジェクト: jafarkhani/rtfund
 function Add($pdo = null)
 {
     $dt = self::Get(" AND ChequeNo=? AND ChequeDate=?", array($this->ChequeNo, DateModules::shamsi_to_miladi($this->ChequeDate)));
     if ($dt->rowCount() > 0) {
         ExceptionHandler::PushException("چک دیگری با این شماره و تاریخ قبلا ثبت شده است");
         return false;
     }
     return parent::Add($pdo);
 }
コード例 #23
0
ファイル: baseInfo.class.php プロジェクト: jafarkhani/rtfund
 public function Remove($pdo = null)
 {
     $dt = parent::runquery("select * from BSC_persons where PostID=?", array($this->PostID), $pdo);
     if (count($dt) > 0) {
         ExceptionHandler::PushException("این پست به فردی نسبت داده شده است و قابل حذف نمی باشد");
         return false;
     }
     $this->IsActive = "NO";
     return $this->Edit($pdo);
 }
コード例 #24
0
 public function doTick()
 {
     if (!$this->rakLib->isTerminated()) {
         $this->interface->sendTick();
     } else {
         $info = $this->rakLib->getTerminationInfo();
         $this->network->unregisterInterface($this);
         \ExceptionHandler::handler(E_ERROR, "RakLib Thread crashed [" . $info["scope"] . "]: " . (isset($info["message"]) ? $info["message"] : ""), $info["file"], $info["line"]);
     }
 }
コード例 #25
0
ファイル: templates.class.php プロジェクト: jafarkhani/rtfund
 public function Remove($pdo = null)
 {
     $res = parent::runquery("select count(*) from CNT_contracts where TemplateID = ? limit 1", array($this->TemplateID), $pdo);
     if ($res[0]['count(*)'] > 0) {
         parent::runquery("update " . static::TableName . " set IsActive='NO' where TemplateID=?", array($this->TemplateID));
         return ExceptionHandler::GetExceptionCount() == 0;
     }
     parent::runquery("delete from CNT_TemplateItems where TemplateID=?", array($this->TemplateID), $pdo);
     return parent::Remove($pdo);
 }
コード例 #26
0
ファイル: Controller.php プロジェクト: rootfather/scummvm-web
 /**
  * Constructor that will create a Smarty object and configure it according
  * to what's been specified in config.inc.
  */
 public function __construct()
 {
     /* Create a Smarty object. */
     $this->_smarty = new Smarty();
     # Stick it globally so we could refer the translations
     global $Smarty;
     $Smarty = $this->_smarty;
     global $lang;
     global $available_languages;
     /* Configure smarty. */
     $this->_smarty->compile_dir = SMARTY_DIR_COMPILE;
     $this->_smarty->cache_dir = SMARTY_DIR_CACHE;
     $this->_smarty->config_dir = SMARTY_DIR_CONFIG;
     $this->_smarty->request_use_auto_globals = SMARTY_USE_GLOBALS;
     $this->_smarty->caching = SMARTY_CACHING_ENABLE;
     $this->_smarty->cache_lifetime = SMARTY_CACHING_LIFETIME;
     $this->_smarty->compile_check = SMARTY_CACHING_COMPILE_CHECK;
     $this->_smarty->force_recheck = SMARTY_CACHING_FORCE_RECHECK;
     $this->_smarty->template_dir = array("templates_{$lang}", 'templates');
     $this->_smarty->compile_id = $lang;
     $this->_smarty->config_dir = ".";
     # First we read English, so al defaults are there
     $this->_smarty->config_load(DIR_LANG . "/lang.ini");
     # Now we try to read translations
     if (is_file($fname = DIR_LANG . "/lang.{$lang}.ini") && is_readable($fname)) {
         $this->_smarty->config_load($fname);
     }
     setlocale(LC_TIME, $Smarty->_config[0]['vars']['locale']);
     /**
      * Add a output-filter to make sure ampersands are properly encoded to
      * HTML-entities.
      */
     $this->_smarty->register_outputfilter(array(&$this, 'outputFilter'));
     /* Give Smarty-template access to date(). */
     $this->_smarty->register_modifier('date_f', array(&$this, 'date_f'));
     $this->_smarty->register_modifier('date_localized', array(&$this, 'date_localized'));
     /* Give Smarty-templates access to the ampersandEntity() function. */
     $this->_smarty->register_modifier('escapeAmpersand', array(&$this, 'ampersandEntity'));
     $this->_title = '';
     $this->_css_files = array();
     $this->_js_files = array();
     $this->_show_intro = false;
     $this->_content_title = '';
     $this->_content = '';
     /* The menus have caused an exception, need to skip them. */
     if (!ExceptionHandler::skipMenus()) {
         $menus = MenuModel::getAllMenus();
     }
     # Construct lang URL
     $pageurl = preg_replace('/\\?lang=[a-z]*$/', '', $_SERVER['REQUEST_URI']);
     /* Set up the common variables before displaying. */
     $vars = array('release' => RELEASE, 'baseurl' => URL_BASE, 'heroes_num' => HEROES_NUM, 'menus' => $menus, 'pageurl' => $pageurl, 'available_languages' => $available_languages);
     $this->_smarty->assign($vars);
 }
コード例 #27
0
function removeCC()
{
    $result = manage_cost_centers::Remove($_POST["cid"]);
    if (!$result) {
        Response::createObjectiveResponse(false, ExceptionHandler::GetExceptionsToString());
        die;
    } else {
        Response::createObjectiveResponse(true, "");
        die;
    }
}
コード例 #28
0
ファイル: tax_tables.data.php プロジェクト: jafarkhani/rtfund
function deleteTax()
{
    $obj = new manage_Tax_Table($_POST["tax_table_id"]);
    $return = $obj->RemoveTax();
    if ($return) {
        echo Response::createResponse(true, $obj->tax_table_id);
    } else {
        echo Response::createResponse(false, ExceptionHandler::ConvertExceptionsToJsObject());
    }
    die;
}
コード例 #29
0
ファイル: staff_tax.data.php プロジェクト: jafarkhani/rtfund
function saveTaxHisGrid()
{
    $obj = new manage_staff_tax();
    PdoDataAccess::FillObjectByJsonData($obj, $_POST["record"]);
    if ($obj->tax_history_id == "") {
        $return = $obj->SaveStaffTaxHistory($_POST['PersonID']);
    } else {
        $return = $obj->EditStaffTaxHistory($_POST['PersonID']);
    }
    echo $return ? Response::createObjectiveResponse(true, $obj->staff_id) : Response::createObjectiveResponse(false, ExceptionHandler::GetExceptionsToString("\n"));
    die;
}
コード例 #30
0
 static function MenuChanger()
 {
     if (Auth::isAdmin(App::$instance)) {
         ST::deployTemplate('menus/admin.inc');
     } else {
         ST::deployTemplate('menus/user.inc');
     }
     //под меню добавить слушателя сообщений
     ExceptionHandler::messageException();
     //выдать путь для js, $init должен быть инициирован выше
     ST::setVarPhptoJS(App::$instance->opt->appHttpPath, "appHttpPath");
 }