public static function func_shutdown()
 {
     $isFatalError = false;
     $isMinorError = false;
     $error = error_get_last();
     if ($error) {
         switch ($error['type']) {
             case E_ERROR:
             case E_CORE_ERROR:
             case E_COMPILE_ERROR:
             case E_USER_ERROR:
                 $isFatalError = true;
                 break;
             case E_WARNING:
             case E_USER_WARNING:
                 $isMinorError = true;
         }
     }
     if ($isFatalError) {
         $errorbox = new errors();
         $errorbox->func_html_fatalerrorbox($error['message'], $error['file'], $error['line']);
     } else {
         if ($isMinorError) {
             $errorbox = new errors();
             $errorbox->func_html_minorerrorbox($error['message'], $error['file'], $error['line']);
         }
     }
 }
示例#2
0
 function prologExpression($element1 = "", $element2 = "", $type = "")
 {
     if ($element1 != '' && $element2 != '' && $type != '') {
         $this->element1 = $element1;
         $this->element2 = $element2;
         $this->type = $type;
         $this->equality = '==';
     } else {
         errors::errorMessage('Expressions cannot be empty!');
     }
 }
示例#3
0
文件: errors.php 项目: rigidus/ea
 function set($value, $key = false)
 {
     if (is_array($value)) {
         self::$errors = $value;
     } else {
         if ($key) {
             self::$errors[$key] = $value;
         } else {
             self::$errors[] = $value;
         }
     }
 }
示例#4
0
 function prologVar($varName = "")
 {
     if ($varName != '') {
         if (ctype_alpha($varName[0])) {
             //Ensure that a variable must always start with a capital letter
             $this->name = strtoupper($varName);
         } else {
             errors::errorMessage("Variables have to have the first letter as alphanumeric");
         }
     } else {
         errors::errorMessage("Variables cannot be empty");
     }
 }
示例#5
0
 /**
  * @return Node - next timepoint
  * @param $name String
  * @desc Finds the connections between the given timepoint	
  */
 function findConnections($name)
 {
     $nodeList = array();
     for ($index = 0; $index < sizeof($this->edges); $index++) {
         if ($result = $this->edges[$index]->match($name)) {
             array_push($nodeList, $result);
         }
     }
     if (sizeof($nodeList) == 1) {
         //Only one choice
         return $nodeList[0];
     } elseif (sizeof($nodeList) > 1) {
         errors::errorMessage('FATAL ERROR PLAN IS NOT TOTALLY ORDERED!!!');
         return false;
     }
     //Failed to match
     return false;
 }
示例#6
0
 function write($filename, $directory, $dataArray)
 {
     if (sizeof($dataArray) && $directory != '' && $filename != '') {
         $directory = "C:/Program Files/Apache Group/Apache2/htdocs/iWFMS/" . $directory;
         $handle = fopen($directory . $filename, "w");
         $keys = array_keys($dataArray);
         for ($index = 0; $index < sizeof($dataArray); $index++) {
             if (!fwrite($handle, $dataArray[$keys[$index]])) {
                 errors::errorMessage("Cannot write to file ({$filename})");
                 return false;
             }
         }
         fclose($handle);
     } else {
         errors::errorMessage("No data was passed to write!");
         return false;
     }
 }
示例#7
0
 function actionTest($planList, $messages, $conditionID, $conditionMode)
 {
     $IDPosition = 0;
     $modePosition = 1;
     $valuePosition = 2;
     $match = false;
     $index = -1;
     while ($index < sizeof($planList) - 1 && !$match) {
         $index++;
         $actionNode = $planList[$index]->getAction();
         $actionNodeData = $actionNode->getData();
         $edgeProgression = $actionNodeData[0];
         $edgeActionValues = $edgeProgression->getPredicateValues();
         //$condition = $edgeActionValues[sizeof($edgeActionValues)-1];
         //$conditionValues = $condition->getPredicateValues();
         $conditionValue = $edgeActionValues[$valuePosition]->toString();
         //Examine the message
         $message = planningAgent::see($messages, $conditionID);
         //Finding the matching action packet
         $match = planningAgent::doit($planList[$index], $conditionMode, $conditionValue, $messages, $message, $conditionID);
     }
     if (!$match) {
         errors::errorMessage("No progression was found!");
     } else {
         //Check the chosen action packet
         if ($planList[$index]->atGoal()) {
             //At goal node
             planArchieving::archive($_POST['workflowID']);
             systemMessages::message("Goal Node reached!");
         }
     }
     return $planList[$index];
 }
示例#8
0
<?php

//include_once('phpunit/phpunit.php');
include_once 'includes/configuration/core_configuration.php';
include_once "includes/commonPages/system_header.php";
if (!isset($mode) && !isset($_SESSION['valid_user'])) {
    include "staticform/loginform.php";
    include_once "includes/commonPages/system_footer.php";
} elseif ($mode == 'failed') {
    echo '<div align="center">';
    errors::errorMessage("Incorrect Username or password");
    echo "</div>";
    include "staticform/loginform.php";
    include_once "includes/commonPages/system_footer.php";
} else {
    include "home.php";
}
示例#9
0
文件: v.php 项目: rigidus/ea
 function show($name = 'ERRORS')
 {
     $show = '';
     if (self::$errors) {
         errors::set(self::$errors);
         errors::show($name);
         return false;
     } else {
         return true;
     }
 }
示例#10
0
 performance::message("Start Prolog Planner");
 $filename = prolog::transferToProlog($_SESSION['valid_user'], array(":- multifile axiom/2.\n", $mode->toString() . ".\n", "axiom(user(" . string::low($_SESSION['valid_user']) . "),[])."));
 $plans = prolog::exec('planGenerationCGI.pl', 'main', $filename);
 //Keep this for the demo
 //$plans="[[[happens(formEntry(superForm,joseph,superuser),t54,t54),happens(edgeProgression(loop(formEntry(assessForm,_A,_B)),formElement(approvePharmacyChanges,match,false)),t100,t100),happens(createFormElement(radio,[82,101,106,101,99,116,32,80,104,97,114,109,97,99,121,32,67,104,97,110,103,101,115],approvePharmacyChanges,false,[]),t97,t97),happens(createFormElement(radio,[65,112,112,114,111,118,101,32,80,104,97,114,109,97,99,121,32,67,104,97,110,103,101,115],approvePharmacyChanges,true,[]),t96,t96),happens(formSubmission(failedDrugsApproval),t95,t95),happens(formEntry(admissionForm,joseph,receptionist),t18,t18),happens(databaseFetch(drugsFailure),t91,t91),happens(formEntry(failedDrugsApproval,joseph,doctor),t89,t89),happens(createFormElement(textbox,[80,97,116,105,101,110,116,32,78,97,109,101],patientName,'',[size=30]),t23,t23),happens(createFormElement(textbox,[72,111,117,115,101,32,78,117,109,98,101,114],houseNumber,'',[size=50]),t24,t24),happens(edgeProgression(checkdrugs,formElement(correction,presence,none)),t85,t85),happens(edgeProgression(checkdrugs,formElement(correctDrugs,match,false)),t84,t84),happens(createFormElement(radio,[82,101,106,101,99,116,32,100,114,117,103,115],correctDrugs,false,[]),t81,t81),happens(createFormElement(radio,[65,112,112,114,111,118,101,32,100,114,117,103,115],correctDrugs,true,[]),t80,t80),happens(createFormElement(textarea,[68,114,117,103,32,67,111,114,114,101,99,116,105,111,110,115],correction,'',[rows=20,cols=40]),t79,t79),happens(edgeProgression(superForm,formElement(nameee,presence,none)),t78,t78),happens(formSubmission(checkdrugs),t75,t75),happens(databaseFetch(drugsSpec),t73,t73),happens(createFormElement(textbox,[82,111,97,100],road,'',[disabled,size=50]),t25,t25),happens(formEntry(checkdrugs,joseph,pharmacist),t67,t67),happens(createFormElement(textbox,[65,103,101],age,'',[disabled,size=50]),t26,t26),happens(createFormElement(select,[87,97,114,100],ward,'',[size=1]),t27,t27),happens(edgeProgression(assessForm,formElement(drugs,presence,none)),t63,t63),happens(createFormElement(radio,[116,101,115,116,50],test2,false,[]),t60,t60),happens(createFormElement(radio,[116,101,115,116,49],test2,true,[]),t59,t59),happens(formSubmission(superForm),t58,t58),happens(createFormElement(option,[80,108,101,97,115,101,32,115,101,108,101,99,116,32,97,32,87,97,114,100],empty,'',[]),t28,t28),happens(createFormElement(textarea,[68,114,117,103,32,112,101,114,115,99,114,105,112,116,105,111,110],drugs,'',[rows=30,cols=30]),t53,t53),happens(formSubmission(assessForm),t52,t52),happens(createFormElement(option,[65,100,117,108,116,115,32,87,97,114,100],childrensWard,adultWard,[]),t29,t29),happens(formEntry(assessForm,joseph,doctor),t48,t48),happens(createFormElement(option,[67,104,105,108,100,114,101,110,115,32,87,97,114,100],adultWard,childrensWard,[]),t30,t30),happens(createFormElement(endSelect,'',ward,'',[]),t31,t31),happens(edgeProgression(admissionForm,formElement(ward,presence,none)),t44,t44),happens(edgeProgression(admissionForm,formElement(patientName,presence,none)),t43,t43),happens(entry(admissionForm,houseNumber,presence,none),t34,t34),happens(entry(admissionForm,road,presence,none),t35,t35),happens(entry(admissionForm,ward,match,childrensWard),t37,t37),happens(entry(admissionForm,age,function,lessThan(18)),t36,t36),happens(formSubmission(admissionForm),t22,t22)],[before(t100,t99),before(t99,t),before(t95,t99),before(t91,t96),before(t97,t95),before(t96,t97),before(t83,t89),before(t89,t91),before(t85,t84),before(t84,t83),before(t75,t83),before(t67,t79),before(t81,t73),before(t80,t81),before(t79,t80),before(t78,t77),before(t77,t14),before(t58,t77),before(t62,t67),before(t73,t75),before(t63,t62),before(t52,t62),before(t54,t59),before(t60,t58),before(t59,t60),before(t48,t53),before(t53,t52),before(t42,t48),before(t44,t43),before(t43,t42),before(t22,t42),before(t31,t34),before(t37,t22),before(t36,t37),before(t35,t36),before(t34,t35),before(t18,t23),before(t30,t31),before(t29,t30),before(t28,t29),before(t27,t28),before(t26,t27),before(t25,t26),before(t24,t25),before(t23,t24)]]]";
 $stoptime = time::stoptiming();
 performance::message("Stop Prolog Planner");
 flush();
 if ($plans == '' || $plans == '[]') {
     // No plan generated
     echo '<br><br>';
     errors::errorMessage('No plans were generated!');
 } elseif (preg_match('/HTML Typing/', $plans)) {
     // Typing error detected!
     echo '<br><Br>';
     errors::errorMessage($plans);
 } else {
     performance::message("Start Prolog Planner parsing");
     //Preformance overhead lies here!
     $planGraphList = GraphConversion::convertStringPrologPlansToGraphs($plans);
     $workFlowvalues = array();
     $workFlowvalues['timestamp'] = $modified = time::ts_unix_mysql(time::timestamp());
     //Create a new workflow item
     $keyinserted = dbs::irrecord('workflow', $workFlowvalues, false);
     //Link all plans to this workflow item
     $newstoptime = time::stoptiming() - $stoptime;
     $stoptime = time::stoptiming();
     performance::message("Stop Prolog Planner parsing");
     if ($model['workflowCaching']) {
         saveCachePlans($planGraphList, $keyinserted, $modelId);
     } else {
示例#11
0
 /**
  * @return void
  * @desc
  */
 function resolveLoops()
 {
     //Find all Nodes which move back to the goal
     $newoptions = $this->planGraph->findBackwardsConnections('t');
     for ($index = 0; $index < sizeof($newoptions); $index++) {
         $graph = $this->planGraph;
         $node = $graph->findNode($newoptions[$index]);
         $nodeData = $node->getData();
         if (preg_match("/loop\\(/", $node->toString())) {
             errors::errorMessage("LOOP DETECTED!");
             $value = $nodeData[0]->getPredicateValues();
             $loopPoint = $value[0]->getPredicateValues();
             echo $loopPoint[0]->toString();
         }
     }
 }
示例#12
0
        $page = FCore::LoadMaster();

        $page->apply_string("title", "Boyds Nest");
        $page->apply_string("meta", "");
        $page->apply_string("javascript", "");

        return $page;
    }

    public function unknown_error()
    {
        
    }

    public function must_be_logged_in()
    {
        
    }
}

try
{
    $page = new errors();
    echo $page->init_request(IsSetGet(ACTION, 'default'));
}
catch(Exception $e)
{
    FCore::ShowError(500, $e);
}

?>
示例#13
0
$smarty->compile_check = TRUE;
$smarty->debugging = 0;
$smarty->template_dir = $smarty_dir . 'templates/';
$smarty->compile_dir = $smarty_dir . 'templates_c/';
$smarty->cache_dir = $smarty_dir . 'cache/';
$smarty->config_dir = $smarty_dir . 'configs/';
//Подключаем классы
spl_autoload_register(function ($class) {
    $class_path = 'lib/' . $class . '.class.php';
    if (file_exists($class_path)) {
        require_once $class_path;
    }
});
$adsStore = AdsStore::instance();
$adsStore->getAllAdsFromDb();
$errors = new errors(array('title', 'description', 'price', 'seller_name', 'phone'));
//передаем 'имя переменной' и 'значение'
$smarty->assign('title', 'Наше объявление');
$smarty->assign('city', $adsStore->getlocationid());
$smarty->assign('category', $adsStore->getCategories());
if (isset($_POST['seller_name'])) {
    if (isset($_POST['privat'])) {
        $ad = new AdsCompany($_POST);
    } else {
        $ad = new AdsPrivatePerson($_POST);
    }
}
//условие для ckick_id (редактирование объявления)
if (isset($_GET['click_id'])) {
    //если объявление уже добавлено,то кликаем по нему
    $adsStore = AdsStore::instance();
示例#14
0
 /**
  * @return String
  * @param String $table
  * @desc return the primary key of table
  */
 function getprimarykey($table)
 {
     $result = dbs::selrecord('*', $table, '0', '0', '0');
     $i = 0;
     while ($i < mysql_num_fields($result)) {
         $meta = mysql_fetch_field($result);
         if (!$meta) {
             errors::errorMessage("No information available<br />\n");
             mysql_free_result($result);
             return false;
         }
         //multiple_key: $meta->multiple_key
         //primary_key:  $meta->primary_key
         //unique_key:   $meta->unique_key
         if (!$meta->multiple_key && $meta->primary_key) {
             $primkey = $meta->name;
             mysql_free_result($result);
             return $primkey;
         } elseif ($meta->multiple_key) {
             errors::errorMessage('Support for multiple keys is not setup');
         }
         $i++;
     }
 }
示例#15
0
     $response->redirect("{$backend}/pages");
     return;
 } else {
     echo isset($request->trailing);
     die($request->page);
 }
 $db = new database("pages");
 $page = $db->select($request->page);
 if (!is_array($page)) {
 } else {
     $db = new database("blocks");
     $template = new template();
     $include = [];
     $body;
     if ($page['page']['published'] != "published") {
         $error = new errors();
         $error->debug(["Page" => "Page is not published"]);
     }
     if (isset($page['component'])) {
         foreach ($page['component'] as $p) {
             $component = $db->component($p['component']);
             $includes = $component['includes'];
             foreach ($includes['js'] as $js) {
                 $include['js'][] = $js;
             }
             foreach ($includes['css'] as $css) {
                 $include['css'][] = $css;
             }
             $body[$p['widget']][] = $template->frontend($component['layout'], ["component" => $p, "tucan" => $_SERVER['tucan']]);
         }
     }
示例#16
0
                } else {
                }
                $plannerProgress = $newPlannerProgress;
                $newPlannerProgress = array();
            }
        }
    }
    debug::message("edge progression test :" . $edgeProgressionResult);
    if ($edgeProgressionResult) {
        if (!$goal) {
            //No point in updating plans if we have reached the goal
            planningAgent::updatePlans($plans);
        }
        $xmlParser = new XMLtoArray($_POST['formName'] . '.xml');
        $xmlTree = $xmlParser->process();
        //Package the xml data into objects
        $xmlPackage = xmlPackage::package($xmlTree);
        //Display the data as HTML
        xmlDatabase::updateDatabases($xmlPackage, $_POST['workflowID'], $_POST, $goal);
    } else {
        //no progress
        errors::errorMessage("Progression to a new workflow stage failed!");
        $xmlParser = new XMLtoArray("jobSpecification.xml");
        $xmlTree = $xmlParser->process();
        //Package the xml data
        $xmlPackage = xmlPackage::package($xmlTree);
        //Display the data as HTML
        xmlPackage::displayItem($xmlPackage, $_POST['workflowID'], 'workflow', 'Current workflow item');
    }
}
include_once "includes/commonPages/system_footer.php";
示例#17
0
 /**
  * @return Filehandle
  * @desc Open the XML file
  */
 function openXML()
 {
     if (!($fp = fopen($this->directory . $this->file, "r"))) {
         if (isset($this->file)) {
             errors::errorMessage("Could not open XML input " . $this->file);
         } else {
             errors::errorMessage("Could not open XML input ");
         }
         return false;
     }
     return $fp;
 }
示例#18
0
 /**
  * sends out the json response of an jsonapi\errors object to the browser
  * 
  * @see errors->send_response()
  */
 public function send_response($content_type = null, $encode_options = null, $response = null)
 {
     $jsonapi = new errors($this, $this->friendly_message, $this->about_link);
     $jsonapi->send_response($content_type, $encode_options, $response);
     exit;
 }