Exemple #1
0
 public function Evalu()
 {
     printf($this->toString() . "\n");
     if ($this->type === 0) {
         if (!is_numeric($this->value1)) {
             $this->value1 = Find($this->value1);
         }
     }
     if ($this->type === 1) {
         if (!is_numeric($this->value1)) {
             $this->value1 = Find($this->value1);
         }
         $this->value1 = ~$this->value1;
     }
     if ($this->type === 2) {
         if (!is_numeric($this->value1)) {
             $this->value1 = Find($this->value1);
         }
         if (!is_numeric($this->value2)) {
             $this->value2 = Find($this->value2);
         }
         switch ($this->operand) {
             case 'AND':
                 $this->value1 = $this->value1 & $this->value2;
                 break;
             case 'OR':
                 $this->value1 = $this->value1 | $this->value2;
                 break;
             case 'LSHIFT':
                 $this->value1 = $this->value1 << $this->value2;
                 break;
             case 'RSHIFT':
                 $this->value1 = $this->value1 >> $this->value2;
                 break;
             case 'XOR':
                 $this->value1 = $this->value1 ^ $this->value2;
                 break;
         }
     }
     $this->type = 0;
     $this->value2 = null;
     $this->operand = null;
     printf($this->toString() . "\n");
     return $this->value1;
 }
	if(file_exists($ExploreDir.'/'.$Path.'/'.$_FILES['userfile']['name']))
	{
		$error = 'Файл '.$_FILES['userfile']['name'].' существует!';
	}
	else
	{
		move_uploaded_file($_FILES['userfile']['tmp_name'],  $ExploreDir.'/'.$Path.'/'.$_FILES['userfile']['name']);
	}
}

$FindArr = $ContextFind || $Find ? true : false;

if($FindArr)
{
	if($Find && $ContextFind) $FindArr = ContextFind($ContextFind,Find($Find));
	elseif ($Find) $FindArr = Find($Find);
	elseif ($ContextFind) $FindArr = ContextFind($ContextFind);
	
	$Path = "";
}

$lsArr = !$FindArr ? ls($lsdir) : $FindArr;

$Dirs = $lsArr["dirs"];
$Files = $lsArr["files"];

$ParentArr = explode("/",$Path);
array_pop($ParentArr);
$ParentPath = "";
foreach ($ParentArr as $value) $ParentPath .= $value != "" ? "/".$value : "";
Exemple #3
0
<?php

$task = $_POST['task'];
switch ($task) {
    case 'deleteitem':
        DeleteItem();
        break;
    case 'find':
        Find();
        break;
}
function DeleteItem()
{
    $Id = $_POST['id'];
    echo $Id;
}
function Find()
{
    $payments = $_POST['payments'];
    $address = $_POST['address'];
    $prodid = $_POST['prodid'];
    $gaardsnr = $_POST['gaardsnr'];
    $bruksnr = $_POST['bruksnr'];
    $festenr = $_POST['festenr'];
    $seksjonsnr = $_POST['seksjonsnr'];
    $filterfields = array($payments, $address, $prodid, $gaardsnr, $bruksnr, $festenr, $seksjonsnr);
    $text = "";
    foreach ($filterfields as $filter) {
        if ($filter != "") {
            $text .= $filter;
        }
Exemple #4
0
unset($names[0]);
foreach ($names as $pos => $name) {
    $sn = strstr($name, "\\");
    if ($sn) {
        $sn = substr($sn, 1);
    } else {
        $sn = $name;
    }
    $res = Find($ginfo, $sn);
    if (!sizeof($res) && preg_match("/IST(WERT)?\$/", $sn)) {
        $sn = preg_replace("/[._]?IST(WERT)?\$/", "", $sn);
        $res = Find($ginfo, $sn);
    }
    if (!sizeof($res) && preg_match("/_/", $sn)) {
        $sn = preg_replace("/^[^_]+_/", "", $sn);
        $res = Find($ginfo, $sn);
    }
    switch (sizeof($res)) {
        case 0:
            echo translate("Missing column   : %u(%s)", $pos, $name) . "\n";
            break;
        case 1:
            break;
        default:
            echo translate("Multimatch column: %u(%s):", $pos, $name);
            $output = false;
            foreach ($res as $r) {
                if ($output) {
                    echo ", ";
                } else {
                    $output = true;
Exemple #5
0
        $tpl->assign("type", "gifts_for_children");
        $params = array("top_gifts" => 1, "gift_theme" => 4, "rows" => 30, "order_b" => 4);
        $params = array("gift_theme" => 4, "rows" => 10, "order_b" => 4);
        break;
    case 8:
        $tpl->assign("type", "novelty");
        $params = array("ids" => (int) $ids);
        break;
    default:
        header("HTTP/1.0 404 Not Found", true, 404);
        exit;
        break;
}
$GlobalConfig['cur_action']['descr'] = str_replace('<', '', $GlobalConfig['cur_action']['descr']);
$GlobalConfig['cur_action']['descr'] = str_replace('>', '', $GlobalConfig['cur_action']['descr']);
$itemsList = Find(0, $params, "shortlist&props");
//print_R(Find(0,$params,"shortlist&props","stringsql"));
// пїЅпїЅпїЅпїЅ пїЅпїЅпїЅ-пїЅпїЅ пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅ
if (is_array($itemsList) && count($itemsList)) {
    $warecodes = array_keys($itemsList);
    // previewText - 3 пїЅпїЅпїЅпїЅпїЅ
    $sql = "\r\n\r\n    SELECT *\r\n\r\n    FROM new_options\r\n\r\n    WHERE warecode in (" . join(",", $warecodes) . ")\r\n\r\n    ORDER BY sort\r\n\r\n    LIMIT 3\r\n\r\n  ";
    $db->query($sql);
    if (mysql_num_rows($db->Query_ID) > 0) {
        while ($row = mysql_fetch_assoc($db->Query_ID)) {
            if ($row['title']) {
                $itemsList[$row['warecode']]['options'][] = $row;
            }
        }
    }
    // detailText - пїЅпїЅпїЅ-пїЅпїЅ + пїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ
Exemple #6
0
';
            Insert($file, $pos1, $text, $error);
        }
        echo 'SUCCESS File: ' . $file . ' Text already installed <br />';
    }
} else {
    $rep = '
		<td class="right"><?php echo $product["total"]; $s = $product["total"]; $s = trim(preg_replace ("/[^0-9.]/","",$s)); $s = preg_replace("| +|", "", $s); $s = (float)str_replace(",",".",$s); $summa = $summa+$s; ?></td> 
		<td class="right"><?php $p = $product["bprice"]*$product["quantity"]; $d = $s-$p; if ($p == 0) $d = 0; $profit = $profit+$d; echo $d; ?></td>  <!--*suppler*-->';
    Replace($file, $pos, $text, $rep, $error);
}
$text = '<?php if ($products) { ?>';
$pos = Find($file, $text, 1);
if ($pos == 'no') {
    $text = '<?php $summa = 0.0; if ($products) { ?>';
    $pos = Find($file, $text, 1);
    if ($pos == 'no') {
        echo 'PERHAPS Text already replaced in file: ' . $file . ' <br />';
    } else {
        $rep = '<?php $summa = 0.0; $profit = 0.0; if ($products) { ?>';
        Replace($file, $pos, $text, $rep, $error);
        echo 'SUCCESS File: ' . $file . ' Text installed <br />';
    }
} else {
    $rep = '<?php $summa = 0.0; $profit = 0.0; if ($products) { ?>  <!--*suppler*-->';
    Replace($file, $pos, $text, $rep, $error);
    echo 'SUCCESS File: ' . $file . ' Text installed <br />';
}
$text = 'column_total';
$pos = FindAfter2($file, $text, 1);
if ($pos == 'yes') {