当前位置: 首页>>代码示例>>PHP>>正文


PHP db_modify函数代码示例

本文整理汇总了PHP中db_modify函数的典型用法代码示例。如果您正苦于以下问题:PHP db_modify函数的具体用法?PHP db_modify怎么用?PHP db_modify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了db_modify函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: slet_bilag

function slet_bilag($bilag_id, $filnavn, $kilde_id, $kilde)
{
    @session_start();
    $s_id = session_id();
    $css = "../css/standard.css";
    # Flyttet
    #	include("../includes/connect.php");
    #	include("../includes/online.php");
    #	include("../includes/std_func.php");
    $r = db_fetch_array(db_select("select * from grupper where art='FTP'", __FILE__ . " linje " . __LINE__));
    $box1 = $r['box1'];
    $box2 = $r['box2'];
    $box3 = $r['box3'];
    if ($kilde == "kassekladde") {
        $mappe = $r['box4'];
        $undermappe = "kladde_{$kilde_id}";
        $ftpfilnavn = "bilag_" . $bilag_id;
    } else {
        $mappe = $r['box5'];
        $undermappe = "debitor_{$kilde_id}";
        $ftpfilnavn = "doc_" . $bilag_id;
    }
    $fp = fopen("../temp/{$db}/ftpscript.{$bruger_id}", "w");
    if ($fp) {
        fwrite($fp, "cd {$mappe}\ncd {$undermappe}\nrm {$ftpfilnavn}\nbye\n");
    }
    fclose($fp);
    if (!isset($exec_path)) {
        $exec_path = "/usr/bin";
    }
    $kommando = "cd ../temp/{$db}\n{$exec_path}/ncftp ftp://" . $box2 . ":" . $box3 . "@" . $box1 . " < ftpscript.{$bruger_id} > ftplog\n";
    system($kommando);
    db_modify("update {$kilde} set dokument='' where id='{$bilag_id}'", __FILE__ . " linje " . __LINE__);
}
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:34,代码来源:vis_bilag.php

示例2: singleupdate

function singleupdate($string)
{
    $webservice = '1';
    list($s_id, $tmp) = explode(chr(9), $string);
    if (!$s_id) {
        return '1' . chr(9) . "Missing session ID";
    }
    #	include("../includes/select.php");
    include "../includes/connect.php";
    include "../includes/online.php";
    $linje = NULL;
    $tabels = array('grupper', 'varianter', 'variant_typer', 'shop_ordrer', 'shop_varer', 'adresser', 'shop_adresser');
    $singleupdate = str_replace($s_id, "", $string);
    $singleupdate = str_replace(chr(9), "", $singleupdate);
    $singleupdate = str_replace(chr(10), "", $singleupdate);
    $singleupdate = str_replace(chr(13), "", $singleupdate);
    #	$singleupdate=str_replace(" ","",$singleupdate);
    $singleupdate = strtolower($singleupdate);
    list($table, $tmp) = explode("set", $singleupdate, 2);
    $table = trim($table);
    #if ($table!='adresser')	return('1'.chr(9).$table);
    if (!in_array($table, $tabels)) {
        return '1' . chr(9) . 'Updating ' . $table . ' is not accepted';
    }
    #if ($table!='adresser')	return('1'.chr(9).$svar.":".$singleupdate);
    transaktion('begin');
    $svar = db_modify("update {$table} {$singleupdate}", __FILE__ . " linje " . __LINE__);
    list($fejl, $svar) = explode(chr(9), $svar);
    if ($fejl) {
        return $fejl . chr(9) . $svar;
    } else {
        transaktion('commit');
        return '0' . chr(9) . $id;
    }
}
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:35,代码来源:singleupdate.php

示例3: logoff

function logoff($s_id)
{
    $modulnr = 1;
    include "../includes/connect.php";
    if ($r = db_fetch_array(db_select("select * from online where session_id='{$s_id}'", __FILE__ . " linje " . __LINE__))) {
        db_modify("delete from online where session_id='{$s_id}'", __FILE__ . " linje " . __LINE__);
        return '0' . chr(9) . 'GoodBye';
    } else {
        return '1' . chr(9) . 'No active session';
    }
}
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:11,代码来源:logoff.php

示例4: logon

function logon($string)
{
    @session_start();
    $s_id = session_id();
    list($regnskab, $brugernavn, $password) = explode(chr(9), $string);
    $password = md5($password);
    $unixtime = date("U");
    include "../includes/db_query.php";
    include "../includes/connect.php";
    db_modify("delete from online where  session_id = '{$s_id}'", __FILE__ . " linje " . __LINE__);
    if ($r = db_fetch_array(db_select("select * from regnskab where regnskab = '{$regnskab}'", __FILE__ . " linje " . __LINE__))) {
        if ($db = trim($r['db'])) {
            $connection = db_connect($sqhost, $squser, $sqpass, $sqdb);
            if ($connection) {
                db_modify("insert into online (session_id, brugernavn, db, dbuser) values ('{$s_id}', '{$brugernavn}', '{$db}', '{$squser}')", __FILE__ . " linje " . __LINE__);
                include "../includes/online.php";
                if ($r = db_fetch_array(db_select("select * from brugere where brugernavn = '{$brugernavn}' and kode='{$password}'", __FILE__ . " linje " . __LINE__))) {
                    $rettigheder = trim($r['rettigheder']);
                    $regnskabsaar = $r['regnskabsaar'] * 1;
                    include "../includes/connect.php";
                    $fp = fopen("../temp/.ht_{$db}.log", "a");
                    fwrite($fp, "-- " . $brugernavn . " " . date("Y-m-d H:i:s") . ": OK jeg er inde " . $s_id . "\n");
                    fclose($fp);
                    db_modify("update online set regnskabsaar='{$regnskabsaar}', rettigheder='{$rettigheder}' where session_id='{$s_id}'", __FILE__ . " linje " . __LINE__);
                    $return = '0' . chr(9) . $s_id;
                } else {
                    db_modify("delete from online where  session_id = '{$s_id}'", __FILE__ . " linje " . __LINE__);
                    $return = "1" . chr(9) . "Username or password error";
                }
            } else {
                $return = "1" . chr(9) . "Connection to database failed";
            }
        } else {
            $return = "1" . chr(9) . "Unknown finacial report";
        }
    } else {
        return $return = "1" . chr(9) . "Unknown finacial report";
    }
    return $return;
}
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:40,代码来源:logon.php

示例5: pbsfakt

 function pbsfakt($id)
 {
     if ($id && $id > 0) {
         if ($r = db_fetch_array(db_select("select id from pbs_liste where afsendt = ''", __FILE__ . " linje " . __LINE__))) {
             $liste_id = $r['id'];
         } else {
             $liste_date = date("Y-m-d");
             $afsendt = NULL;
             db_modify("insert into pbs_liste (liste_date,afsendt) values ('{$liste_date}','{$afsendt}')", __FILE__ . " linje " . __LINE__);
             $r = db_fetch_array(db_select("select id from pbs_liste where afsendt = ''", __FILE__ . " linje " . __LINE__));
             $liste_id = $r['id'];
         }
         if (db_fetch_array(db_select("select id from pbs_ordrer where ordre_id = '{$id}'", __FILE__ . " linje " . __LINE__))) {
             echo "Faktura nr {$r['fakturanr']} findes allerede i PBS liste<br>";
         } else {
             $r = db_fetch_array(db_select("select fakturanr, konto_id from ordrer where id = '{$id}'", __FILE__ . " linje " . __LINE__));
             $konto_id = $r['konto_id'];
             db_modify("insert into pbs_ordrer (liste_id,ordre_id) values ('{$liste_id}','{$id}')", __FILE__ . " linje " . __LINE__);
             echo "Faktura nr {$r['fakturanr']} tilf&oslash;jet til PBS liste<br>";
         }
     }
 }
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:22,代码来源:pbsfakt.php

示例6: opdat_0

function opdat_0($version, $dbver)
{
    global $db_id;
    global $s_id;
    global $backup;
    include "../includes/connect.php";
    include "../includes/online.php";
    include "../includes/db_query.php";
    $returside = "../index/logud.php";
    $db = trim($db);
    if (!$backup) {
        system("pg_dump -h {$sqhost} -U {$squser} -W {$sqpass} -f '../temp/{$db}.sql' {$db}");
        print "<table align=center valign=center cellpadding=1 cellspacing=1 border=0\theight=100% width=100%><tbody>";
        print "<tr><td>";
        print "<table align=center valign=center cellpadding=1 cellspacing=1 border=0\theight=25% width=50%><tbody>";
        print "<tr><td align=center>{$font} Systemet opdateres . . . . . .<br></td></tr>";
        print "<tr><td align=center>{$font} Backup foretages . . . . . .<br></td></tr>";
        print "<tr><td align=center><br></td></tr>";
        print "<tr><td align=center>{$font} H&oslash;jreklik her: <a href='../temp/{$db}.sql'>{$db}.sql</a></td></tr>";
        print "<tr><td align=center>{$font} V&aelig;lg \"gem link som\" (eller \"save link as\")</td></tr>";
        print "<tr><td align=center>{$font} og gem backup'en et passende sted</td></tr>";
        print "<tr><td><br></td></tr>";
        print "<tr><td align=center><a href=../includes/opdat_0.php?version={$version}&dbver={$dbver}&backup=OK accesskey=F>{$font} Forts&aelig;t</a><br></td></tr>";
        print "</tbody></table>";
        print "</td></tr>";
        print "</tbody></table>";
        print "<br>";
    }
    if (!$dbver) {
        echo "Variablen dbver ikke sat - kontakt systemansvarlig!!";
        exit;
    }
    if ($dbver < 0.23) {
        transaktion("begin");
        db_modify("ALTER TABLE kladdeliste add bogforingsdate date");
        db_modify("UPDATE grupper set box1 = '0.23' where art = 'VE'");
        transaktion("commit");
    }
    if ($dbver < 0.24) {
        transaktion("begin");
        $x = 0;
        $maxval = 0;
        $query = db_select("SELECT * FROM ordrelinjer");
        while ($row = db_fetch_array($query)) {
            $x++;
            $id[$x] = $row[id];
            $varenr[$x] = $row['varenr'];
            $text[$x] = $row['text'];
            $posnr[$x] = $row['posnr'] * 1;
            $pris[$x] = $row['pris'] * 1;
            $rabat[$x] = $row['rabat'] * 1;
            $lev_varenr[$x] = $row['lev_varenr'];
            $ordre_id[$x] = $row['ordre_id'] * 1;
            $serienr[$x] = $row['serienr'];
            $antal[$x] = $row['antal'] * 1;
            $bogf_konto[$x] = $row['bogf_konto'] * 1;
            if ($maxval < $id[$x]) {
                $maxval = $id[$x];
            }
        }
        $linjeantal = $x;
        db_modify("DROP TABLE ordrelinjer");
        db_modify("CREATE TABLE ordrelinjer (id serial NOT NULL, varenr varchar, text r varchar, posnr smallint, pris numeric, rabat numeric, lev_varenr varchar, ordre_id integer, serienr varchar, antal numeric, bogf_konto integer, PRIMARY KEY (id))");
        for ($x = 1; $x <= $linjeantal; $x++) {
            db_modify("INSERT INTO ordrelinjer (id, varenr, text, posnr, pris, rabat, lev_varenr, ordre_id, serienr, antal, bogf_konto) values ({$id[$x]}, '{$varenr[$x]}', '{$text[$x]}', '{$posnr[$x]}', '{$pris[$x]}', '{$rabat[$x]}', '{$lev_varenr[$x]}', '{$ordre_id[$x]}', '{$serienr[$x]}', '{$antal[$x]}', '{$bogf_konto[$x]}')");
        }
        if ($maxval >= 1) {
            db_modify("select pg_catalog.setval('ordrelinjer_id_seq', {$maxval}, true)");
        }
        db_modify("CREATE TABLE batch_kob (id serial NOT NULL, kobsdate date, vare_id integer, ordre_id integer, pris numeric, antal integer, rest integer, PRIMARY KEY (id))");
        db_modify("CREATE TABLE batch_salg (id serial NOT NULL, salgsdate date, batch_kob_id integer, vare_id integer, ordre_id integer, pris numeric, antal integer, PRIMARY KEY (id))");
        db_modify("CREATE TABLE serienr (id serial NOT NULL, vare_id integer, kobsordre_id integer, salgsordre_id integer, serienr varchar, PRIMARY KEY (id))");
        db_modify("UPDATE grupper set box1 = '0.24' where art = 'VE'");
        transaktion("commit");
    }
    if ($dbver < 0.26) {
        transaktion("begin");
        db_modify("ALTER TABLE ordrelinjer ADD vare_id integer");
        db_modify("ALTER TABLE ordrer ADD kred_ord_id integer");
        db_modify("UPDATE grupper set box1 = '0.26' where art = 'VE'");
        transaktion("commit");
    }
    if ($dbver < 0.27) {
        transaktion("begin");
        print "Opdaterer til ver. 0.27<br>";
        db_modify("ALTER TABLE varer ADD samlevare varchar");
        db_modify("ALTER TABLE varer ADD delvare varchar");
        db_modify("ALTER TABLE ordrer ADD lev_adr text");
        db_modify("CREATE TABLE styklister (id serial NOT NULL, vare_id integer, indgaar_i integer, antal integer, PRIMARY KEY (id))");
        db_modify("UPDATE grupper set box1 = '0.27' where art = 'VE'");
        transaktion("commit");
    }
    if ($dbver < 0.29) {
        transaktion("begin");
        print "Opdaterer til ver. 0.29<br>";
        db_modify("ALTER TABLE brugere ADD rettigheder varchar");
        db_modify("UPDATE brugere set rettigheder='1111111111'");
        db_modify("ALTER TABLE styklister ADD posnr integer");
        transaktion("commit");
        include "../includes/connect.php";
//.........这里部分代码省略.........
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:101,代码来源:opdat_0.php

示例7: flet

function flet($id, $varenr, $flet_id, $flet_vnr)
{
    if ($r = db_fetch_array(db_select("select id,shop_id from shop_varer where saldi_id = '{$id}'", __FILE__ . " linje " . __LINE__))) {
        $shop_id = $r['shop_id'];
        $r = db_fetch_array(db_select("select samlevare from varer where id = '{$flet_id}'", __FILE__ . " linje " . __LINE__));
        $fletsamlevare = $r['samlevare'];
        if ($r = db_fetch_array(db_select("select id,shop_id from shop_varer where saldi_id = '{$flet_id}'", __FILE__ . " linje " . __LINE__))) {
            if ($shop_id != $r['shop_id']) {
                print tekstboks("Varenummer: {$varenr} har en shop_relation til shop vare med id: {$shop_id} og {$fletvnr} relaterer til shop vare {$r['shop_id']}<br> Sammenlægning kan ikke gennemføres");
                print "<meta http-equiv=\"refresh\" content=\"2;URL=varekort.php?id={$id}\">";
                exit;
            }
        }
    }
    transaktion('begin');
    print tekstboks("Varenummer: {$varenr} sammenlægges med {$fletvnr}");
    $r = db_fetch_array(db_select("select beholdning from varer where id = '{$id}'", __FILE__ . " linje " . __LINE__));
    if ($r['beholdning']) {
        $fletbeholdning = $r['beholdning'];
        if ($fletsamlevare) {
            $x = 0;
            $q = db_select("select * from styklister where indgaar_i='{$flet_id}'");
            while ($r = db_fetch_array($q)) {
                $vare_id[$x] = $r['vare_id'];
                $antal[$x] = $r['antal'];
                $x++;
            }
            for ($x = 0; $x < count($vare_id); $x++) {
                $r = db_fetch_array(db_select("select gruppe,beholdning from varer where id='{$vare_id[$x]}'", __FILE__ . " linje " . __LINE__));
                $r2 = db_fetch_array(db_select("select box8 from grupper where art='VG' and kodenr='{$r['gruppe']}'", __FILE__ . " linje " . __LINE__));
                if ($r2['box8'] == 'on') {
                    $ny_beholdning = $r['beholdning'] + $antal[$x] * $fletbeholdning;
                    db_modify("update varer set beholdning = '{$ny_beholdning}' where id ='{$vare_id[$x]}'", __FILE__ . " linje " . __LINE__);
                }
            }
        } else {
            db_modify("update varer set beholdning=beholdning+{$r['beholdning']} where id = '{$flet_id}'", __FILE__ . " linje " . __LINE__);
        }
    }
    db_modify("update batch_salg set vare_id = '{$flet_id}' where vare_id = '{$id}'", __FILE__ . " linje " . __LINE__);
    db_modify("update batch_kob set vare_id = '{$flet_id}' where vare_id = '{$id}'", __FILE__ . " linje " . __LINE__);
    db_modify("update ordrelinjer set vare_id = '{$flet_id}', varenr = '{$flet_vnr}' where vare_id = '{$id}'", __FILE__ . " linje " . __LINE__);
    db_modify("update vare_lev set vare_id = '{$flet_id}' where vare_id = '{$id}'", __FILE__ . " linje " . __LINE__);
    $r = db_fetch_array(db_select("select id from shop_varer where saldi_id = '{$flet_id}'", __FILE__ . " linje " . __LINE__));
    if (!$r['saldi_id']) {
        db_modify("update shop_varer set saldi_id = '{$flet_id}' where saldi_id = '{$id}'", __FILE__ . " linje " . __LINE__);
    }
    db_modify("delete from varer where id = '{$id}'", __FILE__ . " linje " . __LINE__);
    transaktion('commit');
    print "<meta http-equiv=\"refresh\" content=\"0;URL=varekort.php?id={$flet_id}\">";
}
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:51,代码来源:ret_varenr.php

示例8: db_select

            }
            $query = db_select("select id from kontoplan where kontonr = {$kontonr} and regnskabsaar = '{$regnaar}'", __FILE__ . " linje " . __LINE__);
            $row = db_fetch_array($query);
            $id = $row['id'];
        }
    } elseif ($id > 0) {
        if (!$fra_kto) {
            $fra_kto = 0;
        }
        if (!$til_kto) {
            $til_kto = 0;
        }
        if ($r = db_fetch_array(db_select("select id from kontoplan where kontonr = {$kontonr} and regnskabsaar = '{$regnaar}' and id!='{$id}'", __FILE__ . " linje " . __LINE__))) {
            print "<BODY onLoad=\"javascript:alert('Der findes allerede en konto med nr: {$kontonr}')\">";
        } else {
            db_modify("update kontoplan set kontonr = {$kontonr}, beskrivelse = '{$beskrivelse}', kontotype = '{$kontotype}', moms = '{$moms}', fra_kto = '{$fra_kto}', til_kto = '{$til_kto}', genvej='{$genvej}', lukket = '{$lukket}' where id = '{$id}'", __FILE__ . " linje " . __LINE__);
        }
    }
    genberegn($regnaar);
}
if ($id > 0) {
    $query = db_select("select * from kontoplan where id = '{$id}'", __FILE__ . " linje " . __LINE__);
    if ($row = db_fetch_array($query)) {
        $id = $row['id'];
        $kontonr = $row['kontonr'] * 1;
        $beskrivelse = htmlentities(stripslashes($row['beskrivelse']), ENT_COMPAT, $charset);
        $kontotype = $row['kontotype'];
        #		$katagori=$row['katagori'];
        $moms = $row['moms'];
        $fra_kto = $row['fra_kto'];
        #		$til_kto=$row['til_kto'];
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:31,代码来源:kontokort.php

示例9: posbogfor

function posbogfor($kasse, $regnstart)
{
    global $afd;
    global $brugernavn;
    #cho $_POST['udtages']."<br>";
    $udtages = if_isset($_POST['udtages']);
    if ($udtages) {
        $udtages = usdecimal($udtages) * 1;
    }
    #cho "select ansat_id from brugere where brugernavn = '$brugernavn'<br>";
    $r = db_fetch_array(db_select("select ansat_id from brugere where brugernavn = '{$brugernavn}'", __FILE__ . " linje " . __LINE__));
    $ansat_id = $r['ansat_id'];
    $r = db_fetch_array(db_select("select box2,box3 from grupper where art = 'POS' and kodenr = '1'", __FILE__ . " linje " . __LINE__));
    $kassekonti = explode(chr(9), $r['box2']);
    $kassekonto = $kassekonti[$kasse - 1];
    $afdelinger = explode(chr(9), $r['box3']);
    $afd = $afdelinger[$kasse - 1] * 1;
    $r = db_fetch_array(db_select("select box8 from grupper where art = 'POS' and kodenr = '2'", __FILE__ . " linje " . __LINE__));
    $mellemkonti = explode(chr(9), $r['box8']);
    $mellemkonto = $mellemkonti[$kasse - 1];
    $x = 0;
    #cho "select distinct(fakturadate) as fakturadate from ordrer where felt_5='$kasse' and konto_id= '0' and art = 'PO' and status='3' and fakturadate >= '$regnstart' order by fakturadate<br>\n";
    $q = db_select("select distinct(fakturadate) as fakturadate from ordrer where felt_5='{$kasse}' and (konto_id='0' or betalingsbet='Kontant') and art = 'PO' and status='3' and fakturadate >= '{$regnstart}' order by fakturadate", __FILE__ . " linje " . __LINE__);
    while ($r = db_fetch_array($q)) {
        if ($r['fakturadate']) {
            $x++;
            $fakturadate[$x] = $r['fakturadate'];
            #cho "$fakturadate[$x]<br>\n";
        }
    }
    $x = 0;
    #cho "select distinct(felt_1) as betaling from ordrer where felt_5='$kasse' and konto_id= '0' and art = 'PO' and status='3' and fakturadate >= '$regnstart' order by felt_1<br>\n";
    $q = db_select("select distinct(felt_1) as betaling from ordrer where felt_5='{$kasse}' and (konto_id='0' or betalingsbet='Kontant') and art = 'PO' and status='3' and fakturadate >= '{$regnstart}' order by felt_1", __FILE__ . " linje " . __LINE__);
    while ($r = db_fetch_array($q)) {
        if ($r['betaling']) {
            $x++;
            $betaling[$x] = $r['betaling'];
            #cho "$betaling[$x]<br>\n";
        }
    }
    $x = 0;
    #cho "select distinct(felt_3) as betaling2 from ordrer where felt_5='$kasse' and konto_id= '0' and art = 'PO' and status='3' and fakturadate >= '$regnstart' order by felt_3<br>\n";
    $q = db_select("select distinct(felt_3) as betaling2 from ordrer where felt_5='{$kasse}' and (konto_id='0' or betalingsbet='Kontant') and art = 'PO' and status='3' and fakturadate >= '{$regnstart}' order by felt_3", __FILE__ . " linje " . __LINE__);
    while ($r = db_fetch_array($q)) {
        if ($r['betaling2']) {
            $x++;
            $betaling2[$x] = $r['betaling2'];
        }
    }
    for ($x = 1; $x <= count($fakturadate); $x++) {
        for ($y = 0; $y <= count($betaling); $y++) {
            for ($z = 0; $z <= count($betaling2); $z++) {
                $id = NULL;
                $q = db_select("select id from ordrer where felt_5='{$kasse}' and fakturadate='{$fakturadate[$x]}' and felt_1='{$betaling[$y]}' and felt_3='{$betaling2[$z]}' and (konto_id='0' or betalingsbet='Kontant') and art = 'PO' and status='3'", __FILE__ . " linje " . __LINE__);
                while ($r = db_fetch_array($q)) {
                    if ($id) {
                        $id .= "," . $r['id'];
                    } else {
                        $id = $r['id'];
                    }
                }
                $r = db_fetch_array(db_select("select box9 from grupper where art='POS' and kodenr='1'", __FILE__ . " linje " . __LINE__));
                if ($id) {
                    transaktion('begin');
                    $svar = bogfor_nu("{$id}", "Dagsafslutning");
                    if ($svar && $svar != 'OK') {
                        #cho "$svar<br>";
                        print "<BODY onLoad=\"javascript:alert('Der er konstateret en uoverenstemmelse i posteringssummen. \\nKontakt Danosoft på telefon 4690 2208 eller 2066 9820')\">\n";
                        print "<meta http-equiv=\"refresh\" content=\"0;URL=pos_ordre.php?id={$id}\">\n";
                    } else {
                        transaktion('commit');
                    }
                }
            }
        }
    }
    if ($kassekonto && $mellemkonto && $udtages) {
        $dd = date("Y-m-d");
        $logtime = date("H:i");
        if ($udtages > 0) {
            $debet = 0;
            $kredit = $udtages;
        } else {
            $debet = $udtages;
            $kredit = 0;
        }
        db_modify("insert into transaktioner (bilag,transdate,beskrivelse,kontonr,faktura,debet,kredit,kladde_id,afd,logdate,logtime,projekt,ansat,ordre_id) values ('0','{$dd}','Overført til mellemkonto fra kasse {$kasse}','{$kassekonto}','0','{$debet}','{$kredit}',0,'{$afd}','{$dd}','{$logtime}','','{$ansat_id}','0')", __FILE__ . " linje " . __LINE__);
        db_modify("insert into transaktioner (bilag,transdate,beskrivelse,kontonr,faktura,debet,kredit,kladde_id,afd,logdate,logtime,projekt,ansat,ordre_id) values ('0','{$dd}','Overført til mellemkonto fra kasse {$kasse}','{$mellemkonto}','0','{$kredit}','{$debet}',0,'{$afd}','{$dd}','{$logtime}','','{$ansat_id}','0')", __FILE__ . " linje " . __LINE__);
    }
}
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:90,代码来源:pos_ordre_xx.php

示例10: db_modify

            $vis_liste = $vis_liste . '0';
        }
    }
    # brugernavn i box1 er en pre 2.0.7 ting - fremover skal der identificeres paa kodenr / bruger_id.
    db_modify("update grupper set {$box}='{$vis_liste}', kodenr = '{$bruger_id}', kode = '{$brugernavn}' where art = 'DGV' and (box1 = '{$brugernavn}' or kodenr = '{$bruger_id}')", __FILE__ . " linje " . __LINE__);
    if ($popup) {
        print "<BODY onLoad=\"javascript=opener.location.reload();\">";
    }
    print "<meta http-equiv=\"refresh\" content=\"0;URL={$returside}\">";
}
print "<div align=\"center\">\n<table width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tbody>\n\t<tr><td height = \"25\" align=\"center\" valign=\"top\">\n\t\t<table width=\"100%\" align=\"center\" border=\"0\" cellspacing=\"4\" cellpadding=\"0\"><tbody>\n\t\t\t<td width=\"10%\" align=center><div class=\"top_bund\"><a href={$returside} accesskey=L>Luk</a></div></td>\n\t\t\t<td width=\"80%\" align=center><div class=\"top_bund\">{$title}</a></div></td>\n\t\t\t<td width=\"10%\" align=center><div class=\"top_bund\"><br></div></td>\n\t\t\t </tr>\n\t\t\t</tbody></table>\n\t</td></tr>\n <tr><td valign=\"top\">\n<table cellpadding=\"1\" cellspacing=\"1\" border=\"0\" width=\"100%\" valign = \"top\">\n<tbody>";
print "<form name=grpvisning action=grpvisning.php?sort={$sort}&side={$side} method=post>";
if ($r = db_fetch_array(db_select("select * from grupper where art = 'DGV' and (box1 = '{$brugernavn}' or kodenr = '{$bruger_id}')", __FILE__ . " linje " . __LINE__))) {
    $vis_liste = $r[$box];
} else {
    db_modify("insert into grupper(beskrivelse, art, kode, kodenr, {$box})values('historikvisning', 'HV','{$brugernavn}', '{$bruger_id}', '1')", __FILE__ . " linje " . __LINE__);
    $vis_liste = '0';
}
print "<tr><td colspan=3>V&aelig;lg hvilke kundegrupper der skal v&aelig;re synlige p&aring; oversigten</td></tr>";
print "<tr><td colspan=3>Hvis intet er valgt, vil alt blive vist!</td></tr>";
print "<tr><td colspan=3><hr></td></tr>";
$q = db_select("select * from grupper where art = 'DG' order by beskrivelse", __FILE__ . " linje " . __LINE__);
$x = -1;
while ($r = db_fetch_array($q)) {
    $x++;
    if (substr($vis_liste, $x, 1) == '1') {
        $tmp = 'checked';
    } else {
        $tmp = '';
    }
    print "<tr><td><input name= box{$x} type=checkbox {$tmp}> {$r['beskrivelse']}</td></tr>";
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:31,代码来源:grpvisning.php

示例11: invoice

function invoice($string)
{
    $webservice = '1';
    $fp = fopen("../temp/invoice.log", "w");
    list($s_id, $tmp) = explode(chr(9), $string);
    if (!$s_id) {
        return '1' . chr(9) . "Missing session ID";
    }
    #	include("../includes/select.php");
    include "../includes/connect.php";
    include "../includes/online.php";
    include "../includes/std_func.php";
    include "../includes/ordrefunc.php";
    include "../includes/formfunk.php";
    $linje = NULL;
    $ordre_id = str_replace($s_id, "", $string);
    $ordre_id = str_replace(chr(9), "", $ordre_id);
    $ordre_id = str_replace(chr(10), "", $ordre_id);
    $ordre_id = str_replace(chr(13), "", $ordre_id);
    #	$ordre_id=str_replace(" ","",$ordre_id);
    $ordre_id = strtolower($ordre_id);
    list($table, $tmp) = explode("set", $ordre_id, 2);
    $table = trim($table);
    $r = db_fetch_array(db_select("select momssats from ordrer where id = '{$ordre_id}'", __FILE__ . " linje " . __LINE__));
    $momssats = $r['momssats'] * 1;
    $x = 0;
    $ordresum = 0;
    $momssum = 0;
    $kostsum = 0;
    $momsdiff = 0;
    $q = db_select("select * from ordrelinjer where ordre_id = '{$ordre_id}'", __FILE__ . " linje " . __LINE__);
    while ($r = db_fetch_array($q)) {
        if ($r['vare_id']) {
            $linjesum = $r['pris'] * $r['antal'] - $r['pris'] * $r['antal'] * $r['rabat'] / 100;
            $ordresum += $linjesum;
            $linjemoms = $linjesum * $r['momssats'] / 100;
            $momssum += $linjemoms;
            if ($r['momssats'] != $momssats || $r['momsfri']) {
                $momsdiff = 1;
            }
            $kostsum += $r['kostpris'] * $r['antal'];
        }
        $ordresum = afrund($ordresum, 2);
        if (!$momsdiff) {
            $momssum = $ordresum * $momssats / 100;
        }
        $momssum = afrund($momssum, 2);
    }
    transaktion('begin');
    $linje = "update ordrer set status = '2',levdate = ordredate,fakturadate = ordredate,sum='{$ordresum}',moms='{$momssum}',udskriv_til='email',mail_fakt='on',momssats='{$momssats}',kostpris='{$kostsum}',projekt='' where id = '{$ordre_id}'";
    fwrite($fp, $linje . "\n");
    $svar = db_modify($linje, __FILE__ . " linje " . __LINE__);
    list($fejl, $svar) = explode(chr(9), $svar);
    if ($fejl) {
        return $fejl . chr(9) . $svar;
    }
    $linje = "update ordrelinjer set projekt = '' where ordre_id = '{$ordre_id}'";
    fwrite($fp, $linje . "\n");
    $svar = db_modify($linje, __FILE__ . " linje " . __LINE__);
    list($fejl, $svar) = explode(chr(9), $svar);
    if ($fejl) {
        return $fejl . chr(9) . $svar;
    }
    $linje = "update ordrelinjer set leveres = antal where ordre_id = '{$ordre_id}' and vare_id>'0'";
    fwrite($fp, $linje . "\n");
    $svar = db_modify($linje, __FILE__ . " linje " . __LINE__);
    list($fejl, $svar) = explode(chr(9), $svar);
    if ($fejl) {
        return $fejl . chr(9) . $svar;
    }
    $linje = "levering({$ordre_id},'on','','on')";
    fwrite($fp, $linje . "\n");
    $svar = levering($ordre_id, 'on', '', 'on');
    if ($svar != 'OK') {
        return '1' . chr(9) . $svar;
    }
    $linje = "update ordrelinjer set leveret = antal,leveres='0' where ordre_id = '{$ordre_id}' and vare_id>'0'";
    fwrite($fp, $linje . "\n");
    $svar = db_modify($linje, __FILE__ . " linje " . __LINE__);
    $linje = "bogfor({$ordre_id},'on')";
    fwrite($fp, $linje . "\n");
    $svar = bogfor($ordre_id, 'on');
    list($fejl, $svar) = explode(chr(9), $svar);
    fwrite($fp, $fejl . " " . $svar . "\n");
    if ($fejl != 'OK') {
        $linje = "{$fejl}";
        #		fwrite($fp,$linje."\n");
        return '1' . chr(9) . $fejl;
    } else {
        transaktion('commit');
    }
    $linje = "formularprint({$ordre_id},'4','1',{$charset},'email')";
    fwrite($fp, $linje . "\n");
    $svar = formularprint($ordre_id, '4', '1', $charset, 'email');
    fwrite($fp, $linje . "Svar " . $svar . "\n");
    if ($svar && $svar != 'OK') {
        return '1' . chr(9) . $svar;
    } else {
        fclose($fp);
        return '0' . chr(9) . $ordre_id;
//.........这里部分代码省略.........
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:101,代码来源:invoice.php

示例12: isset

isset($_GET['start']) ? $start = $_GET['start'] : ($start = 1);
$slut = $start + 999;
$x = 0;
$r = db_fetch_array(db_select("SELECT relfilenode FROM pg_class WHERE relname = 'variant_varer'", __FILE__ . " linje " . __LINE__));
$relfilenode = $r['relfilenode'] * 1;
$r = db_fetch_array(db_select("SELECT * FROM pg_attribute WHERE attrelid= '{$relfilenode}' and attname = 'variant_salgspris'", __FILE__ . " linje " . __LINE__));
if ($r['attisdropped'] != 'f' || !$r['attname']) {
    db_modify("alter TABLE variant_varer ADD variant_salgspris numeric(15,3)", __FILE__ . " linje " . __LINE__);
}
$r = db_fetch_array(db_select("SELECT * FROM pg_attribute WHERE attrelid= '{$relfilenode}' and attname = 'variant_kostpris'", __FILE__ . " linje " . __LINE__));
if ($r['attisdropped'] != 'f' || !$r['attname']) {
    db_modify("alter TABLE variant_varer ADD variant_kostpris numeric(15,3)", __FILE__ . " linje " . __LINE__);
}
$r = db_fetch_array(db_select("SELECT * FROM pg_attribute WHERE attrelid= '{$relfilenode}' and attname = 'variant_vejlpris'", __FILE__ . " linje " . __LINE__));
if ($r['attisdropped'] != 'f' || !$r['attname']) {
    db_modify("alter TABLE variant_varer ADD variant_vejlpris numeric(15,3)", __FILE__ . " linje " . __LINE__);
}
$q = db_select("select * from varianter", __FILE__ . " linje " . __LINE__);
while ($r = db_fetch_array($q)) {
    $varianter_id[$x] = $r['id'];
    $varianter_beskrivelse[$x] = $r['beskrivelse'];
    $varianter_shop_id[$x] = $r['shop_id'];
    $x++;
}
$x = 0;
$q = db_select("select * from variant_typer", __FILE__ . " linje " . __LINE__);
while ($r = db_fetch_array($q)) {
    $varianttyper_id[$x] = $r['id'];
    $varianttyper_beskrivelse[$x] = $r['beskrivelse'];
    $varianttyper_shop_id[$x] = $r['shop_id'];
    #echo "$varianttyper_id[$x] $varianttyper_beskrivelse[$x]<br>";
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:31,代码来源:exporter_variantvarer.php

示例13: if_isset

    $id = $_GET['id'];
}
if ($id && $id >= 1) {
    $modulnr = 5;
    include "../includes/connect.php";
    include "../includes/online.php";
    include "../includes/std_func.php";
    include "../includes/ordrefunc.php";
    include "../includes/fuld_stykliste.php";
    $hurtigfakt = if_isset($_GET['hurtigfakt']);
    $genfakt = if_isset($_GET['genfakt']);
    $pbs = if_isset($_GET['pbs']);
    $mail_fakt = if_isset($_GET['mail_fakt']);
    transaktion("begin");
    $svar = levering($id, $hurtigfakt, $genfakt, 0);
    if ($svar == 'OK') {
        transaktion("commit");
        if ($hurtigfakt == 'on') {
            db_modify("update ordrer set status=2 where id='{$id}' and status<2", __FILE__ . " linje " . __LINE__);
            print "<meta http-equiv=\"refresh\" content=\"0;URL=bogfor.php?id={$id}&genfakt={$genfakt}&mail_fakt={$mail_fakt}&pbs={$pbs}\">";
            exit;
        } else {
            print "<meta http-equiv=\"refresh\" content=\"0;URL=ordre.php?id={$id}\">";
        }
    } else {
        print "<BODY onLoad=\"javascript:alert('{$svar}')\">";
    }
}
?>
</body></html>
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:30,代码来源:levering.php

示例14: overfoer_data


//.........这里部分代码省略.........
                    }
                    if ($feltnavn[$y] == 'kontoansvarlig' && $felt[$y] && $kontonr) {
                        $r = db_fetch_array(db_select("select id from adresser where kontonr='{$kontonr}'", __FILE__ . " linje " . __LINE__));
                        $konto_id = $r['id'] * 1;
                        $r = db_fetch_array(db_select("select id from ansatte where initialer='{$felt[$y]}' and konto_id={$konto_id}", __FILE__ . " linje " . __LINE__));
                        $felt[$y] = $r['id'] * 1;
                    } elseif ($feltnavn[$y] == 'kontoansvarlig') {
                        $felt[$y] = '0';
                    }
                    if ($feltnavn[$y] == 'oprettet' && $felt[$y] && $kontonr) {
                        $felt[$y] = usdate($felt[$y]);
                    } elseif ($feltnavn[$y] == 'oprettet') {
                        $felt[$y] = date("Y-m-d");
                    }
                    if ($feltnavn[$y] == 'kreditmax') {
                        $felt[$y] = usdecimal($felt[$y]);
                    }
                    if ($feltnavn[$y] == 'betalingsdage') {
                        $felt[$y] = $felt[$y] * 1;
                    }
                }
            }
            if ($skriv_linje == 1) {
                $addr_a = '';
                $addr_b = '';
                $upd = '';
                $kontakt_a = '';
                $kontakt_b = '';
                for ($y = 0; $y <= $feltantal; $y++) {
                    if ($feltnavn[$y] && $feltnavn[$y] != 'husnr' && $feltnavn[$y] != 'etage') {
                        $felt[$y] = trim(addslashes($felt[$y]));
                        if (!strstr($feltnavn[$y], "kontakt_")) {
                            if ($y > 0) {
                                $addr_a = $addr_a . ",";
                                $addr_b = $addr_b . ",";
                                $upd = $upd . ",";
                            }
                            $addr_a = $addr_a . $feltnavn[$y];
                            $addr_b = $addr_b . "'" . $felt[$y] . "'";
                            $upd = $upd . $feltnavn[$y] . "='" . $felt[$y] . "'";
                        } else {
                            if ($kontakt_a) {
                                $kontakt_a = $kontakt_a . ",";
                                $kontakt_b = $kontakt_b . ",";
                            }
                            $tmp = substr($feltnavn[$y], 8);
                            $kontakt_a = $kontakt_a . $tmp;
                            $kontakt_b = $kontakt_b . "'" . $felt[$y] . "'";
                        }
                    }
                }
                if (!strpos($addr_a, 'lukket')) {
                    $addr_a = $addr_a . ",lukket";
                    $addr_b = $addr_b . ",''";
                }
                if (!strpos($addr_a, 'gruppe')) {
                    $addr_a = $addr_a . ",gruppe";
                    $addr_b = $addr_b . ",'1'";
                    $upd = $upd . ",gruppe='1'";
                }
                if (!strpos($addr_a, 'art')) {
                    $addr_a = $addr_a . ",art";
                    $addr_b = $addr_b . ",'{$art}'";
                    $upd = $upd . ",art='{$art}'";
                } else {
                    for ($y = 0; $y <= $feltantal; $y++) {
                        if ($feltnavn[$y] == 'art') {
                            $art = $felt[$y];
                        }
                    }
                }
                if ($r = db_fetch_array(db_select("select id from adresser where kontonr='{$kontonr}' and art='{$art}'", __FILE__ . " linje " . __LINE__))) {
                    $konto_id = $r['id'];
                    $imp_antal++;
                    # echo "update adresser set $upd where id='$konto_id'<br>";
                    db_modify("update adresser set {$upd} where id='{$konto_id}'", __FILE__ . " linje " . __LINE__);
                } else {
                    $imp_antal++;
                    db_modify("insert into adresser({$addr_a},kontotype) values ({$addr_b},'{$kontotype}')", __FILE__ . " linje " . __LINE__);
                    $r = db_fetch_array(db_select("select id from adresser where kontonr='{$kontonr}' and art = 'D'", __FILE__ . " linje " . __LINE__));
                    $konto_id = $r['id'];
                }
                if ($kontakt_a && !($r = db_fetch_array(db_select("select id from ansatte where konto_id='{$konto_id}'", __FILE__ . " linje " . __LINE__)))) {
                    db_modify("insert into ansatte({$kontakt_a},konto_id) values ({$kontakt_b},'{$konto_id}')", __FILE__ . " linje " . __LINE__);
                }
            }
        }
    }
    fclose($fp);
    transaktion('commit');
    print "</tbody></table>";
    print "</td></tr>";
    print "<BODY onLoad=\"javascript:alert('{$imp_antal} adresser importeret')\">";
    if ($popup) {
        print "<meta http-equiv=\"refresh\" content=\"0;URL=../includes/luk.php\">";
    } else {
        print "<meta http-equiv=\"refresh\" content=\"0;URL=../systemdata/diverse.php\">";
    }
    #exit;
}
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:101,代码来源:importer_debitor.php

示例15: vareopslag

function vareopslag($sort, $fokus, $id, $vis_kost, $ref, $find, $retur)
{
    global $bgcolor;
    global $bgcolor5;
    if ($find) {
        $find = str_replace("*", "%", $find);
        $find = " and {$fokus} like {$find} and id!='{$id}'";
    } else {
        $find = " and id!='{$id}'";
    }
    #	sidehoved($id, "$retur", "../lager/$retur", $fokus, "Kundeordre $id - vareopslag");
    #	print"<table width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tbody>";
    #	print"<tr><td valign=\"top\">";
    print "<table cellpadding=\"1\" cellspacing=\"1\" border=\"0\t\" width=\"100%\" valign = \"top\">";
    print "<tbody><tr>";
    print "<td><a href=\"{$retur}?fokus={$fokus}&id={$id}\">Luk</a></td>";
    if ($vis_kost) {
        print "<td colspan=7 align=center><a href={$retur}?sort=varenr&funktion=vareopslag&x={$x}&fokus={$fokus}&id={$id}&find={$find}>Udelad kostpriser</a></td></tr>";
    } else {
        print "<td colspan=3 align=center><a href={$retur}?sort=varenr&funktion=vareopslag&x={$x}&fokus={$fokus}&id={$id}&vis_kost=on&find={$find}>Vis kostpriser</a></td></tr>";
    }
    print "<td><b><a href={$retur}?sort=varenr&funktion=vareopslag&x={$x}&fokus={$fokus}&id={$id}&vis_kost={$vis_kost}&find={$find}>Varenr</a></b></td>";
    print "<td><b> Enhed</b></td>";
    print "<td><b><a href={$retur}?sort=beskrivelse&funktion=vareopslag&x={$x}&fokus={$fokus}&id={$id}&vis_kost={$vis_kost}&find={$find}>Beskrivelse</a></b></td>";
    print "<td align=right><b><a href={$retur}?sort=salgspris&funktion=vareopslag&x={$x}&fokus={$fokus}&id={$id}&find={$find}>Salgspris</a></b></td>";
    if ($vis_kost) {
        print "<td align=right><b> Kostpris</b></td>";
    }
    print "<td align=right><b><a href={$retur}?sort=beholdning&funktion=vareopslag&x={$x}&fokus={$fokus}&id={$id}&vis_kost={$vis_kost}&find={$find}>Beh.</a></b></td>";
    print "<td><br></td>";
    #	print"<td><br></td><td><b>Kunde</b></td>";
    print " </tr>\n";
    print "<tr><td colspan=\"6\"><hr></td></tr>";
    if ($ref) {
        if ($row = db_fetch_array(db_select("select afd from ansatte where navn = '{$ref}'"))) {
            if ($row = db_fetch_array(db_select("select kodenr from grupper where box1='{$row['afd']}' and art='LG'"))) {
                $lager = $row['kodenr'];
            }
        }
    }
    $lager = $lager * 1;
    if (!$sort) {
        $sort = varenr;
    }
    if ($find) {
        $query = db_select("select * from varer where lukket != '1' {$find} order by {$sort}");
    } else {
        $query = db_select("select * from varer where lukket != '1' order by {$sort}");
    }
    while ($row = db_fetch_array($query)) {
        $query2 = db_select("select box8 from grupper where art='VG' and kodenr='{$row['gruppe']}'");
        $row2 = db_fetch_array($query2);
        if ($row2[box8] == 'on' || $row[samlevare] == 'on') {
            if ($row[beholdning] != '0' and !$row[beholdning]) {
                db_modify("update varer set beholdning='0' where id={$row['id']}");
            }
        } elseif ($row[beholdning]) {
            db_modify("update varer set beholdning='0' where id={$row['id']}");
        }
        if ($linjebg != $bgcolor) {
            $linjebg = $bgcolor;
            $color = '#000000';
        } else {
            $linjebg = $bgcolor5;
            $color = '#000000';
        }
        print "<tr bgcolor=\"{$linjebg}\">";
        print "<td><a href=\"{$retur}?vare_id={$row['id']}&fokus={$fokus}&id={$id}\">{$row['varenr']}</a></td>";
        print "<td>{$row['enhed']}<br></td>";
        print "<td>{$row['beskrivelse']}<br></td>";
        $salgspris = dkdecimal($row[salgspris]);
        print "<td align=right>{$salgspris}<br></td>";
        if ($vis_kost == 'on') {
            $query2 = db_select("select kostpris from vare_lev where vare_id = {$row['id']} order by posnr");
            $row2 = db_fetch_array($query2);
            $kostpris = dkdecimal($row2[kostpris]);
            print "<td align=right>{$kostpris}<br></td>";
        }
        $reserveret = 0;
        #		$linjetext="<span title= 'Der er $y i tilbud og $z i ordre '>";
        if ($lager >= 1) {
            $q2 = db_select("select * from batch_kob where vare_id={$row['id']} and rest>0 and lager={$lager}");
            while ($r2 = db_fetch_array($q2)) {
                $q3 = db_select("select * from reservation where batch_kob_id={$r2['id']}");
                while ($r3 = db_fetch_array($q3)) {
                    $reserveret = $reserveret + $r3[antal];
                }
            }
            $linjetext = "<span title= 'Reserveret: {$reserveret}'>";
            if ($r2 = db_fetch_array(db_select("select beholdning from lagerstatus where vare_id={$row['id']} and lager={$lager}"))) {
                print "<td align=right>{$linjetext} {$r2['beholdning']}</span></td>";
            }
        } else {
            $q2 = db_select("select * from batch_kob where vare_id={$row['id']} and rest > 0");
            while ($r2 = db_fetch_array($q2)) {
                $q3 = db_select("select * from reservation where batch_kob_id={$r2['id']}");
                while ($r3 = db_fetch_array($q3)) {
                    $reserveret = $reserveret + $r3[antal];
                }
            }
//.........这里部分代码省略.........
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:101,代码来源:vareopslag.php


注:本文中的db_modify函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。