コード例 #1
0
ファイル: bubs.php プロジェクト: philum/cms
function bub_root($d, $dir = '')
{
    switch ($dir) {
        //pre-rendered, intercepte navigation
        case 'batch':
            req('tri,pop,ajxf');
            return batch('', 'c');
            break;
        case 'fastmenu':
            return bub_adm_admin_fast();
            break;
        case 'search':
            return bub_search_btn('', 18, 'srchb');
            break;
        case 'addart':
            return bub_addart_btn();
            break;
        case 'ucom':
            return bub_ucom_btn();
            break;
        case 'arts':
            return bub_adm_arts_fast();
            break;
        case 'user':
            return bub_adm_user_fast();
            break;
        case 'exec':
            return bub_exec($d);
            break;
        case 'hubs':
            $r = bub_hubs_fast();
            break;
        case 'bub':
            $r = bub_slct($d);
            break;
    }
    if (!$r) {
        $r = bub_root_slct($d, $dir);
    }
    //if($d==navs)
    return bub_apps($r, $d, $dir, $cond);
}
コード例 #2
0
ファイル: ajax.php プロジェクト: philum/cms
     $ret = slct_frm($id, $va);
     break;
     //read
 //read
 case "readart":
     sleep(1);
     req('pop,spe,mod,tri,art');
     $_GET["continue"] = 1;
     $_SESSION["read"] = $id;
     $ret = read_msg($id, 3);
     break;
     //batch
 //batch
 case "batch":
     req('tri,pop');
     $ret = batch($id, $va);
     if (!$va) {
         $t = $n;
     }
     $s = 550;
     break;
 case "batchfbi":
     req('tri');
     $ret = batchfbi();
     break;
 case "batchprep":
     req('tri');
     $ret = batch_prep($id);
     break;
 case "cmption":
     req('spe,meta');
コード例 #3
0
ファイル: ordrefunc.php プロジェクト: nielsrune/saldi_ce
function batch_salg_lev($id, $levdate, $fakturadate, $beholdning, $vare_id, $antal, $pris, $nettopris, $linje_id, $linje_nr, $posnr, $serienr, $lager)
{
    # Denne funktion bruges til ved levering af varer som er underlagt batchkontrol
    # Kaldes fra funktionen linjeopdat...
    global $sn_id;
    global $lev_nr;
    global $fp;
    $rest = $antal;
    $sn_start = 0;
    $kobsbelob = 0;
    $a = 0;
    $res_sum = 0;
    $res_linje_antal = 0;
    if (!db_fetch_array(db_select("select * from reservation where linje_id = {$linje_id}", __FILE__ . " linje " . __LINE__))) {
        batch($linje_id);
    }
    #Hvis der ikke manuelt er reserveret varer tages automatisk fra den ldste indkbsordre
    $query = db_select("select * from reservation where linje_id = {$linje_id}", __FILE__ . " linje " . __LINE__);
    #Finder reserverede varer som er koebt hjem
    while (($row = db_fetch_array($query)) && $res_sum < $antal) {
        $x++;
        $batch_kob_id[$x] = $row['batch_kob_id'];
        $res_antal[$x] = $row['antal'];
        $res_sum = $res_sum + $row['antal'];
        $lager = $row['lager'];
        if ($res_sum >= $antal) {
            #Indsat 091106 for
            $diff[$x] = $res_sum - $antal;
            $res_antal[$x] = $res_antal[$x] - $diff[$x];
            $res_sum = $antal;
        }
    }
    $res_linje_antal = $x;
    $rest = $rest - $res_sum;
    if ($rest > 0) {
        #Hvis ikke alle varer er koebt hjem eller reserveret saaaa....
        if ($r = db_fetch_array(db_select("select * from reservation where batch_salg_id = {$linje_id}*-1 and antal = {$rest}", __FILE__ . " linje " . __LINE__))) {
            #Finder reserverede varer som er bestilt hos lev.
            #Hvis linjen eksisterer indsættes en linje i batch_salg
            db_modify("insert into batch_salg(vare_id, linje_id, salgsdate, ordre_id, antal, lev_nr) values ({$vare_id}, {$linje_id}, '{$levdate}', {$id}, {$rest}, '{$lev_nr}')", __FILE__ . " linje " . __LINE__);
            $q2 = db_select("select id from batch_salg where vare_id={$vare_id} and linje_id={$linje_id} and salgsdate='{$levdate}' and ordre_id={$id} and antal={$rest} and\tlev_nr='{$lev_nr}' order by id desc", __FILE__ . " linje " . __LINE__);
            $r2 = db_fetch_array($q2);
            $batch_salg_lev_id = $r2['id'];
            #Reservationen opdateres med ID fra batch salg
            db_modify("update reservation set batch_salg_id='{$batch_salg_lev_id}' where batch_salg_id={$linje_id}*-1", __FILE__ . " linje " . __LINE__);
            lagerstatus($vare_id, $lager, $rest);
        } else {
            print "<BODY onLoad=\"javascript:alert('Reserveret antal stemmer ikke overens med antal til levering (pos nr: {$posnr})')\">";
            $r2 = db_fetch_array(db_select("select art from ordrer where id = '{$id}'", __FILE__ . " linje " . __LINE__));
            #20131105
            if ($r2['art'] == 'PO') {
                print "<meta http-equiv=\"refresh\" content=\"0;URL=pos_ordre.php?id={$id}\">";
            } else {
                print "<meta http-equiv=\"refresh\" content=\"0;URL=ordre.php?id={$id}\">";
            }
            exit;
        }
    } else {
        $rest = $antal;
    }
    for ($x = 1; $x <= $res_linje_antal; $x++) {
        $query = db_select("select * from batch_kob where id={$batch_kob_id[$x]}", __FILE__ . " linje " . __LINE__);
        if ($row = db_fetch_array($query)) {
            $kob_antal = $row['antal'];
            $kob_rest = $row['rest'];
            $kob_ordre_id = $row['ordre_id'];
            $kob_pris = $row['pris'];
            $lager = $row['lager'];
            if (!$kob_pris) {
                $kob_pris = '0';
            }
            $kob_rest = $kob_rest - $res_antal[$x];
            #cho "A update batch_kob set rest=$kob_rest where id=$batch_kob_id[$x]<br>";
            db_modify("update batch_kob set rest={$kob_rest} where id={$batch_kob_id[$x]}", __FILE__ . " linje " . __LINE__);
            db_modify("insert into batch_salg(batch_kob_id, vare_id, linje_id, salgsdate, ordre_id, antal, lev_nr) values ({$batch_kob_id[$x]}, {$vare_id}, {$linje_id}, '{$levdate}', {$id}, {$res_antal[$x]}, '{$lev_nr}')", __FILE__ . " linje " . __LINE__);
            $query2 = db_select("select id from batch_salg where batch_kob_id={$batch_kob_id[$x]} and vare_id={$vare_id} and linje_id={$linje_id} and salgsdate='{$levdate}' and ordre_id={$id} and antal={$res_antal[$x]} and\tlev_nr='{$lev_nr}' order by id desc", __FILE__ . " linje " . __LINE__);
            $row2 = db_fetch_array($query2);
            if ($serienr) {
                db_modify("update serienr set batch_salg_id={$row2['id']} where salgslinje_id={$linje_id}", __FILE__ . " linje " . __LINE__);
            }
            db_modify("update ordrelinjer set leveres='0' where id='{$linje_id}'", __FILE__ . " linje " . __LINE__);
            if ($diff[$x]) {
                db_modify("update reservation set antal='{$diff[$x]}' where linje_id='{$linje_id}' and vare_id='{$vare_id}' and batch_kob_id='{$batch_kob_id[$x]}'", __FILE__ . " linje " . __LINE__);
            } else {
                db_modify("delete from reservation where linje_id='{$linje_id}' and vare_id='{$vare_id}' and batch_kob_id='{$batch_kob_id[$x]}'", __FILE__ . " linje " . __LINE__);
            }
            lagerstatus($vare_id, $lager, $rest);
            $rest = 0;
        } else {
            print "<BODY onLoad=\"javascript:alert('Hmm - Indkbsordre kan ikke findes - levering kan ikke foretages - Kontakt systemadministrator')\">";
            print "<meta http-equiv=\"refresh\" content=\"0;URL=ordre.php?id={$id}\">";
            exit;
        }
    }
}
コード例 #4
0
            $cursor->next();
        }
    }
    $end = micro_time();
    $total = $end - $start;
    $ops = PER_TRIAL / $total;
    echo "total time: {$total}\n";
    echo "ops/sec: {$ops}\n";
    echo "------\n";
}
$small = array("x" => 0);
$medium = array("x" => 0, "integer" => 5, "number" => 5.05, "boolean" => false, "array" => array("test", "benchmark"));
$large = array("x" => 0, "base_url" => "http://www.example.com/test-me", "total_word_count" => 6743, "access_time" => new MongoDate(), "meta_tags" => array("description" => "i am a long description string", "author" => "Holly Man", "dynamically_created_meta_tag" => "who know\n what"), "page_structure" => array("counted_tags" => 3450, "no_of_js_attached" => 10, "no_of_images" => 6), "harvested_words" => array("10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo"));
batch($db->selectCollection("small_none"), $small);
batch($db->selectCollection("medium_none"), $medium);
batch($db->selectCollection("large_none"), $large);
none($db->selectCollection("small_none"), $small);
none($db->selectCollection("medium_none"), $medium);
none($db->selectCollection("large_none"), $large);
index($db->selectCollection("small_index"), $small);
index($db->selectCollection("medium_index"), $medium);
index($db->selectCollection("large_index"), $large);
find_one($db->selectCollection("small_none"));
find_one($db->selectCollection("medium_none"));
find_one($db->selectCollection("large_none"));
find_one($db->selectCollection("small_index"));
find_one($db->selectCollection("medium_index"));
find_one($db->selectCollection("large_index"));
find($db->selectCollection("small_none"));
find($db->selectCollection("medium_none"));
find($db->selectCollection("large_none"));
コード例 #5
0
#
#
#
#
#
#
#
#
#
#
#
# Get settings
require "settings.php";
require "libs/acc.lib.php";
# Display default output
$OUTPUT = batch();
# Get templete
require "template.php";
# View the batch File
function batch()
{
    # query the DB
    core_connect();
    $sql = "SELECT * FROM batch WHERE proc ='no' ORDER BY refnum ASC";
    $rslt = db_exec($sql);
    # get records
    $trans = "";
    while ($rec = pg_fetch_array($rslt)) {
        foreach ($rec as $key => $value) {
            ${$key} = $value;
        }
コード例 #6
0
ファイル: ajxf.php プロジェクト: philum/cms
function batchfbi()
{
    req('pop');
    $ret = hlpbt('rssurl_1') . br();
    $r = msql_read('', $_SESSION['qb'] . '_rssurl', "", 1);
    $r = msq_tri($r, 3, 1);
    if ($r) {
        foreach ($r as $k => $v) {
            batch_prep($v[0]);
        }
    }
    return batch('', 'in');
}
コード例 #7
0
ファイル: ordre.php プロジェクト: nielsrune/saldi_ce
            $rabat = 0;
        }
        $y = "proc" . $x;
        $procent[$x] = usdecimal(if_isset($_POST[$y]));
        if ($x > 0 && !$procent[$x]) {
            $procent[$x] = 100;
        }
        $y = "ialt" . $x;
        $ialt[$x] = if_isset($_POST[$y]);
        if ($godkend == "on" && $status == 0) {
            if ($vis_saet) {
                $fakturadato = date("d-m-Y");
            }
            $leveres[$x] = $antal[$x];
            if (isset($linje_id[$x]) && $varenr[$x]) {
                batch($linje_id[$x]);
            }
        }
        if (!$sletslut && $posnr_ny[$x] == '->') {
            $sletstart = $x;
        }
        if ($sletstart && $posnr_ny[$x] == '<-') {
            $sletslut = $x;
        }
    }
    if ($sletstart && $sletslut && $sletstart < $sletslut) {
        for ($x = $sletstart; $x <= $sletslut; $x++) {
            $posnr_ny[$x] = "-";
        }
    }
}