Example #1
0
	function printList($sections,$currentSection,$depthLevel=1, $idParent=0)
	{
		if(is_array($sections[$depthLevel][$idParent]))
		{
			echo '<ul>';
			foreach ($sections[$depthLevel][$idParent] as $section) 
			{
				//onClick by section call javascript function which show needed items
				if($section["QUANTITY"])
				{
					echo '<li id="'.$section["ID"].'"><a '.($section["ID"]==$currentSection ? 'class="selected" ' :'')
						.' onclick="showDiv('.$section["ID"].')">'.$section["NAME"];	
				}
				else
				{
					echo '<li id="'.$section["ID"].'">'.$section["NAME"];	
				}	
				
				if($section["QUANTITY"]>0)
					echo " (".$section["QUANTITY"].")";
				echo '</a>';

				printList($sections,$currentSection,$depthLevel+1,$section["ID"]);
				
				echo "</li>";
			}
			echo "</ul>";
		}
	}
Example #2
0
function printList($array = null)
{
    if (count($array)) {
        echo "<ul>";
        foreach ($array as $item) {
            echo "<li>";
            echo $item['label'];
            if (count($item['children'])) {
                echo '&nbsp;&nbsp;' . count($item['children']);
                printList($item['children']);
            }
            echo "</li>";
        }
        echo "</ul>";
    }
}
#The full software license can be found here:
#http://www.accounting-123.com/a.php?a=153/GPLv3
#
#
#
#
#
#
#
#
#
#
#
require "../settings.php";
# show current stock
$OUTPUT = printList();
require "../template.php";
# show stock
function printList()
{
    # Set up table to display in
    $printList = "\r\n    <h3>Supplier Price Lists</h3>\r\n    <table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n    <tr><th>Price List</th><th colspan=4>Options</th></tr>";
    # connect to database
    db_conn("exten");
    # Query server
    $i = 0;
    $sql = "SELECT * FROM spricelist WHERE div = '" . USER_DIV . "' ORDER BY listname ASC";
    $listRslt = db_exec($sql) or errDie("Unable to retrieve Price Lists from database.");
    if (pg_numrows($listRslt) < 1) {
        return "<li>There are no Price Lists in Cubit.";
    }
Example #4
0
function parseTemplate($subject, $template, $language = NULL)
{
    // If template/subTemplate is listed as ignored, return false
    if (isIgnored($template, $tplName)) {
        return false;
    }
    // Find subtemplates and remove Subtemplates, which are listed as ignored!
    preg_match_all('~\\{((?>[^{}]+)|(?R))*\\}~x', $template, $subTemplates);
    foreach ($subTemplates[0] as $key => $subTemplate) {
        $subTemplate = preg_replace("/(^\\{\\{)|(\\}\\}\$)/", "", $subTemplate);
        // Cut Brackets / {}
        if (isIgnored($subTemplate, $tplName)) {
            $template = str_replace('{{' . $subTemplate . '}}', '', $template);
        }
    }
    // Replace "|" inside subtemplates with "\\" to avoid splitting them like triples
    $template = preg_replace_callback("/(\\{{2})([^\\}\\|]+)(\\|)([^\\}]+)(\\}{2})/", 'replaceBarInSubtemplate', $template);
    $equal = preg_match('~=~', $template);
    // Gruppe=[[Gruppe-3-Element|3]]  ersetzt durch Gruppe=[[Gruppe-3-Element***3]]
    do {
        $template = preg_replace('/\\[\\[([^\\]]+)\\|([^\\]]*)\\]\\]/', '[[\\1***\\2]]', $template, -1, $count);
    } while ($count);
    $triples = explode('|', $template);
    if (count($triples) <= $GLOBALS['W2RCFG']['minAttributeCount']) {
        return false;
    }
    $templateName = strtolower(trim(array_shift($triples)));
    //	if(!isBlanknote($subject) && !$GLOBALS['onefile'])
    //		$GLOBALS['filename']=urlencode($templateName).'.'.$GLOBALS['outputFormat'];
    // Array containing URIs to subtemplates. If the same URI is in use already, add a number to it
    $knownSubTemplateURI = array();
    // subject
    $s = $subject;
    $z = 0;
    foreach ($triples as $triple) {
        if ($equal) {
            $split = explode('=', $triple, 2);
            if (count($split) < 2) {
                continue;
            }
            list($p, $o) = $split;
            $p = trim($p);
        } else {
            $p = "property" . ++$z;
            $o = $triple;
        }
        $o = trim($o);
        //if property date and object an timespan we extract it with following special case
        if ($p == "date") {
            $o = str_replace("[", "", str_replace("]", "", $o));
            $o = str_replace("&ndash;", "-", $o);
        }
        // Do not allow empty Properties
        if (strlen($p) < 1) {
            continue;
        }
        if (in_array($p, $GLOBALS['W2RCFG']['ignoreProperties'])) {
            continue;
        }
        if ($o !== '' & $o !== NULL) {
            $pred = $p;
            // if(!$GLOBALS['templateStatistics'] && $GLOBALS['propertyStat'][$p]['count']<10)
            //continue;
            // predicate
            // Write properties CamelCase, no underscores, no hyphens. If first char is digit, add _ at the beginning
            $p = propertyToCamelCase($p);
            // Add prefixProperties if set true in config.inc.php
            if ($GLOBALS['prefixPropertiesWithTemplateName']) {
                $p = propertyToCamelCase($templateName) . '_' . $p;
            } else {
                if (!$equal) {
                    $p = propertyToCamelCase($templateName . "_" . $p);
                }
            }
            // object
            $o = str_replace('***', '|', $o);
            // Remove HTML Markup for whitespaces
            $o = str_replace('&nbsp;', ' ', $o);
            //remove <ref> Content</ref>
            //$o = preg_replace('/(<ref>.+?<\/ref>)/s','',$o);
            // Parse Subtemplates (only parse Subtemplates with values!)
            if (preg_match_all("/(\\{{2})([^\\}]+)(\\}{2})/", $o, $subTemplates, PREG_SET_ORDER)) {
                foreach ($subTemplates as $subTemplate) {
                    // Replace #### back to |, in order to parse subtemplate properly
                    $tpl = str_replace("####", "|", $subTemplate[2]);
                    // If subtemplate contains values, the subject is only the first word
                    if (preg_match("/(^[^\\|]+)(\\|)/", $tpl, $match)) {
                        $subTemplateSubject = $subject . '/' . $p . '/' . $match[1];
                    } else {
                        $subTemplateSubject = $subject . '/' . $p . '/' . $tpl;
                    }
                    // Look up URI in Array containing known URIs, if found add counter to URI.
                    // e.g. http://dbpedia.org/United_Kingdom/footnote/cite_web
                    // ==>  http://dbpedia.org/United_Kingdom/footnote/cite_web1 ...
                    if (!isset($knownSubTemplateURI[$subTemplateSubject])) {
                        // array_push( $knownSubTemplateURI, $subTemplateSubject );
                        $knownSubTemplateURI[$subTemplateSubject] = 0;
                    } else {
                        $knownSubTemplateURI[$subTemplateSubject]++;
                        $subTemplateSubject .= $knownSubTemplateURI[$subTemplateSubject];
                    }
                    // If subtemplate contained real values, write the corresponding triple
                    if (parseTemplate($subTemplateSubject, $tpl)) {
                        writeTripel($s, $GLOBALS['W2RCFG']['propertyBase'] . $p, $subTemplateSubject, 'main', 'r', null, null);
                    }
                }
            }
            // Remove subTemplates from Strings
            $o = str_replace("####", "|", $o);
            $o = preg_replace("/\\{{2}[^\\}]+\\}{2}/", "", $o);
            // Sometimes only whitespace remain, then continue with next triple
            if (preg_match("/^[\\s]*\$/", $o)) {
                continue;
            }
            //replace predicate if necessary to make them unambiguous
            $p = replacePredicate($p);
            // Add URI prefixes to property names
            $p = $GLOBALS['W2RCFG']['propertyBase'] . $p;
            if (isBlanknoteList($o)) {
                printList($s, $p, $o);
            } else {
                list($o, $o_is, $dtype, $lang) = parseAttributeValue($o, $s, $p, $language);
                // special newline handling
                $br = array('<br>', '<br/>', '<br />');
                if ($o_is == 'l') {
                    $o = str_replace($br, "\n", $o);
                } else {
                    if ($o_is == 'r') {
                        $o = str_replace($br, '', $o);
                    }
                }
                if ($o !== NULL) {
                    writeTripel($s, $p, $o, 'main', $o_is, $dtype, $lang);
                }
            }
            //if($GLOBALS['templateStatistics'] && $o!=NULL && $equal) {
            //	$GLOBALS['propertyStat'][$pred]['count']++;
            //	$GLOBALS['propertyStat'][$pred]['maxCountPerTemplate']=max($GLOBALS['propertyStat'][$pred]['maxCountPerTemplate'],++$pc[$pred]);
            //	if(!$GLOBALS['propertyStat'][$pred]['inTemplates'] || !in_array($templateName,$GLOBALS['propertyStat'][$pred]['inTemplates']))
            //		$GLOBALS['propertyStat'][$pred]['inTemplates'][]=$templateName;
            //}
            $extracted = true;
        }
    }
    if (isset($extracted) && $extracted) {
        //writeTripel($s,$GLOBALS['W2RCFG']['templateProperty'],$GLOBALS['W2RCFG']['wikipediaBase'].$GLOBALS['templateLabel'].':'.encodeLocalName($templateName),$GLOBALS['filedecisionTemplate']);
        writeTripel($s, $GLOBALS['W2RCFG']['templateProperty'], $GLOBALS['W2RCFG']['wikipediaBase'] . $GLOBALS['templateLabel'] . ':' . $templateName);
        //if ($GLOBALS['addExplicitTypeTriples'])
        //	printexplicitTyping($templateName,$GLOBALS['filename'],'t');
    }
    if (isset($extracted)) {
        return $extracted;
    } else {
        return false;
    }
}
Example #5
0
    stdOut("Building list of deleted files " . count($changes['deletedFiles']));
    if (count($changes['deletedFiles']) > 0) {
        $l_Result .= '<div class="note_int">' . AI_STR_084 . ' (' . count($changes['deletedFiles']) . ')</div><div class="intitem">';
        $l_Result .= printList($changes['deletedFiles']);
        $l_Result .= "</div>" . PHP_EOL;
    }
    stdOut("Building list of added dirs " . count($changes['addedDirs']));
    if (count($changes['addedDirs']) > 0) {
        $l_Result .= '<div class="note_int">' . AI_STR_085 . ' (' . count($changes['addedDirs']) . ')</div><div class="intitem">';
        $l_Result .= printList($changes['addedDirs']);
        $l_Result .= "</div>" . PHP_EOL;
    }
    stdOut("Building list of deleted dirs " . count($changes['deletedDirs']));
    if (count($changes['deletedDirs']) > 0) {
        $l_Result .= '<div class="note_int">' . AI_STR_086 . ' (' . count($changes['deletedDirs']) . ')</div><div class="intitem">';
        $l_Result .= printList($changes['deletedDirs']);
        $l_Result .= "</div>" . PHP_EOL;
    }
}
if (!isCli()) {
    $l_Result .= QCR_ExtractInfo($l_PhpInfoBody[1]);
}
if (function_exists('memory_get_peak_usage')) {
    $l_Template = str_replace("@@MEMORY@@", AI_STR_043 . bytes2Human(memory_get_peak_usage()), $l_Template);
}
$l_Template = str_replace('@@WARN_QUICK@@', SCAN_ALL_FILES || $g_SpecificExt ? '' : AI_STR_045, $l_Template);
if ($l_ShowOffer) {
    $l_Template = str_replace('@@OFFER@@', $l_Offer, $l_Template);
} else {
    $l_Template = str_replace('@@OFFER@@', AI_STR_002, $l_Template);
}
Example #6
0
<?php

require_once dirname(__FILE__) . '/../vendor/autoload.php';
use Gedex\Container;
$ll = new Container\DoublyLinkedList();
$e1 = $ll->pushFront(1);
$e2 = $ll->pushFront(2);
$e3 = $ll->pushBack('e3');
$e4 = $ll->insertBefore('el before e3', $e3);
$e5 = $ll->insertAfter('el after e3', $e3);
printList($ll);
// --> (2) --> (1) --> (el before e3) --> (e3) --> (el after e4)
printf("Remove element (%s)\n", $e3->getValue());
$ll->remove($e3);
printList($ll);
// --> (2) --> (1) --> (el before e3) --> (el after e4)
function printList($ll)
{
    $el = $ll->getFront();
    while (!is_null($el)) {
        printf('--> (%s) ', $el->getValue());
        $el = $el->getNext();
    }
    printf("\n");
}
Example #7
0
         }
     }
 }
 // Remove subTemplates from Strings
 $o = str_replace("####", "|", $o);
 $o = preg_replace("/\\{{2}[^\\}]+\\}{2}/", "", $o);
 // Sometimes only whitespace remain, then continue with next triple
 if (preg_match("/^[\\s]*\$/", $o)) {
     continue;
 }
 //replace predicate if necessary to make them unambiguous
 $p = replacePredicate($p);
 // Add URI prefixes to property names
 $p = $GLOBALS['W2RCFG']['propertyBase'] . $p;
 if (isBlanknoteList($o)) {
     printList($s, $p, $o);
 } else {
     list($o, $o_is, $dtype, $lang) = $this->parseAttributeValue($o, $s, $p, $language);
     // special newline handling
     $br = array('<br>', '<br/>', '<br />');
     if ($o_is == 'l') {
         $o = str_replace($br, "\n", $o);
     } else {
         if ($o_is == 'r') {
             $o = str_replace($br, '', $o);
         }
     }
     if ($o !== NULL) {
         writeTripel($s, $p, $o, 'main', $o_is, $dtype, $lang);
     }
 }
Example #8
0
			$formaction = 'view';
		}

		if ($formaction == 'list') {
			$sql = mysql_query("select * from {$dbPrefix}BANNED") or $error['mysql'] .= mysql_error()."\n";
			$count = mysql_num_rows($sql);

			$sql = mysql_query("select * from {$dbPrefix}BANNED order by ID desc limit $init,$howmanyitens") or $error['mysql'] .= mysql_error()."\n";

			if($count > 0){
				$listHtml = "<b>Itens ".($init+1)." ~ ".(($count < $init+$howmanyitens) ? $count : $init+$howmanyitens)." / $count</b> (mostrando ".$howmanyitens." por p&aacute;gina)<br/><br/>";

				while($ban = mysql_fetch_array($sql)) {
					$listHtml .= "<a href=".$_SERVER['PHP_SELF']."?type=ban&amp;formaction=view&amp;id=".$ban['ID'].">".$ban['USERIP']." - banido em ".date("d/m/Y H:i",$ban['ID'])."</a><br/>\n";
				}
				$listHtml .= printList();
			}else{
				$listHtml = "n&atilde;o h&aacute; registros.<br/>";
			}

			$formaction = 'add';
		} elseif ($formaction == 'view' && $id) {
			$sql = mysql_query("select * from {$dbPrefix}BANNED where ID='$id'") or $error['mysql'] .= mysql_error()."\n";
			$ban = mysql_fetch_array($sql);

			$ban['USERIP'] = stripslashes($ban['USERIP']);
			$previewHtml = '<b>'.$ban['USERIP'].'</b> banido em '.date('d/m/Y H:i',$ban['ID']).'<br/>';
			$formaction = 'edit';
		} else {
			$formaction = 'post';
		}
Example #9
0
}
stdOut("Building list of doorways " . count($g_Doorway));
if (count($g_Doorway) > 0 && ($defaults['report_mask'] & REPORT_MASK_DOORWAYS) == REPORT_MASK_DOORWAYS) {
    $l_ShowOffer = true;
    $l_Result .= '<div class="note_warn">' . AI_STR_034 . '</div><div class="warn">';
    $l_Result .= printList($g_Doorway);
    $l_Result .= "</div>" . PHP_EOL;
}
stdOut("Building list of php warnings " . (count($g_WarningPHP[0]) + count($g_WarningPHP[1])));
if (($defaults['report_mask'] & REPORT_MASK_SUSP) == REPORT_MASK_SUSP) {
    if (count($g_WarningPHP[0]) + count($g_WarningPHP[1]) > 0) {
        $l_ShowOffer = true;
        $l_Result .= '<div class="note_warn">' . AI_STR_035 . '</div><div class="warn">';
        for ($i = 0; $i < count($g_WarningPHP); $i++) {
            if (count($g_WarningPHP[$i]) > 0) {
                $l_Result .= printList($g_WarningPHP[$i], $g_WarningPHPFragment[$i], true, $g_WarningPHPSig, 'table_warn' . $i);
            }
        }
        $l_Result .= "</div>" . PHP_EOL;
    }
}
stdOut("Building list of skipped dirs " . count($g_SkippedFolders));
if (count($g_SkippedFolders) > 0) {
    $l_Result .= '<div class="note_warn">' . AI_STR_036 . '</div><div class="warn">';
    $l_Result .= implode("<br>", $g_SkippedFolders);
    $l_Result .= "</div>" . PHP_EOL;
}
if (count($g_CMS) > 0) {
    $l_Result .= "<div class=\"note_warn\">" . AI_STR_037 . "<br/>";
    $l_Result .= implode("<br>", $g_CMS);
    $l_Result .= "</div>";
Example #10
0
 function printList($gallery)
 {
     echo "<ul>";
     foreach ($gallery->kids() as $kid) {
         echo "<li>" . $kid->get('id') . " " . $kid->get('name');
         printItemsList($kid);
         printList($kid);
         echo "</li>";
     }
     echo "</ul>";
 }
Example #11
0
// Exit, if script is called directly (must be included via eID in index_ts.php)
if (!defined('PATH_typo3conf')) {
    die('Could not access this script directly!');
}
require_once t3lib_extMgm::extPath('mailformplus_admin') . 'classes/class.tx_mailformplusadmin.php';
$id = isset($HTTP_GET_VARS['id']) ? $HTTP_GET_VARS['id'] : 0;
$pid = htmlspecialchars(t3lib_div::_GP("pid"));
$action = htmlspecialchars(t3lib_div::_GP("action"));
$scope = htmlspecialchars(t3lib_div::_GP("scope"));
$query = htmlspecialchars(t3lib_div::_GP("query"));
$firstrun = htmlspecialchars(t3lib_div::_GP("firstrun"));
$sid = htmlspecialchars(t3lib_div::_GP("sid"));
tslib_eidtools::connectDB();
switch ($action) {
    case "printList":
        echo printList($action, $scope, $query, $pid, $firstrun);
        break;
    case "getEventForm":
        echo getEventForm();
        break;
    case "saveEventForm":
        initTSFE($id);
        echo saveEventForm($query);
        break;
    case "getFormStructure":
        return getFormStructure($action, $scope, $query, $lang, $user, $pid, $firstrun);
        break;
    case "saveFormStructure":
        return saveFormStructure($action, $scope, $query, $lang, $user, $pid, $firstrun);
        break;
    default:
Example #12
0
!empty($_POST['dir']) ? $path = $_POST['dir'] : ($path = "/");
$ftp_hostname = $_POST['hostName'];
$ftp_username = $_POST['hostUserName'];
$ftp_password = $_POST['hostPassword'];
$use_sftp = $_POST['useSftp'];
$port = $_POST['hostPort'];
$args = array('hostname' => $ftp_hostname, 'port' => $port, 'username' => $ftp_username, 'password' => $ftp_password, 'base' => $path);
if ($use_sftp != "") {
    $method = "SFTPExt";
} else {
    $method = "FTPExt";
}
$fileSysObj = initFileSysObj($args, $method);
if ($fileSysObj) {
    $fileList = getFileList($fileSysObj, $path);
    printList($fileList);
}
//FileSystem initilize
function initFileSysObj($args, $method)
{
    require_once APP_ROOT . '/includes/fileSystemBase.php';
    require_once APP_ROOT . '/includes/fileSystem' . ucfirst($method) . '.php';
    $fileSysClass = "fileSystem" . ucfirst($method);
    $fileSysObj = new $fileSysClass($args);
    if (!defined('FS_CONNECT_TIMEOUT')) {
        define('FS_CONNECT_TIMEOUT', 30);
    }
    if (!defined('FS_TIMEOUT')) {
        define('FS_TIMEOUT', 30);
    }
    if (!$fileSysObj->connect()) {