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


PHP insertQuery函数代码示例

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


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

示例1: doJournal

 /**
  * doJournal
  * Lakukan Jurnal berdasarkan data yang diberikan
  */
 public function doJournal($pt, $kodeJurnal, $dataRes, $counter, $ketKelompok = "", $updateCounter = true)
 {
     global $dbname;
     #Cek Nojurnal sudah terdaftar, Jika sudah terdaftar exit
     $sCek = "select nojurnal from " . $dbname . ".keu_jurnaldt where nojurnal='" . $dataRes['header']['nojurnal'] . "'";
     $qCek = mysql_query($sCek) or die(mysql_error($conn));
     $rCek = mysql_num_rows($qCek);
     if ($rCek != 0) {
         exit("warning: Nojurnal :" . $dataRes['header']['nojurnal'] . " sudah ada");
     }
     $qHeader = insertQuery($dbname, 'keu_jurnalht', $dataRes['header']);
     $qDetail = insertQuery($dbname, 'keu_jurnaldt', $dataRes['detail']);
     $dataIns = array($pt, $kodeJurnal, $ketKelompok, $counter);
     $insCounter = insertQuery($dbname, 'keu_5kelompokjurnal', $dataIns);
     $updCounter = updateQuery($dbname, 'keu_5kelompokjurnal', array('nokounter' => $counter), "kodeorg='" . $pt . "' and kodekelompok='" . $kodeJurnal . "'");
     if (!mysql_query($qHeader)) {
         echo "Header DB Error: " . mysql_error() . "\n";
         $this->rbJournal($dataRes['header']['nojurnal']);
         exit;
     } else {
         if (!mysql_query($qDetail)) {
             echo "Detail DB Error: " . mysql_error() . "\n";
             $this->rbJournal($dataRes['header']['nojurnal']);
             exit;
         } else {
             if ($updateCounter) {
                 if (!mysql_query($insCounter)) {
                     // Insert Kelompok Jurnal jika belum ada
                     if (!mysql_query($updCounter)) {
                         // Update jika sudah ada
                         echo "DB Error: " . mysql_error() . "\n";
                         $this->rbJournal($dataRes['header']['nojurnal']);
                         exit;
                     }
                 }
             }
         }
     }
 }
开发者ID:halimc17,项目名称:magsys,代码行数:43,代码来源:zJournal.php

示例2: scraping_test

function scraping_test($url, $num, $conn)
{
    // create HTML DOM
    $url = $num == 1 ? $url : $url . '?s=' . $num;
    $html = file_get_html($url);
    // get Whole class of each product details
    $newVar = $html->find('p[class="row"]');
    $productInformation = array();
    foreach ($newVar as $key => $products) {
        $price = trim($products->find('span.price', 0)->plaintext);
        $title = trim($products->find('a.hdrlnk', 0)->plaintext);
        // remove $ sign from price
        $price = $price == "" ? '0' : str_replace("$", "", $price);
        // We have to create text file to save Data in insert queries
        if ($title != '' && $price != '') {
            $str = "INSERT INTO product_details(id,title,price) VALUES (NULL,'" . addslashes($title) . "',{$price});\n";
        }
        $result = insertQuery($str, $conn);
    }
    $html->clear();
    unset($html);
    return $ret;
}
开发者ID:john5037,项目名称:sooryenTest,代码行数:23,代码来源:scraping.php

示例3: unset

$data = $_POST;
unset($data['proses']);
switch ($_POST['proses']) {
    case 'add':
        # Check Valid Data
        foreach ($data as $key => $row) {
            if ($row == '') {
                echo "Error : Data " . $key . " tidak boleh kosong";
                exit;
            }
        }
        # Unset Data
        unset($data['namabarang']);
        unset($data['satuan']);
        # Make Query
        $query = insertQuery($dbname, 'setup_kegiatannorma', $data);
        # Insert Data
        if (!mysql_query($query)) {
            echo "DB Error : " . mysql_error($conn);
        } else {
            echo $_SESSION['theme'];
        }
        break;
    case 'edit':
        $data = $_POST;
        unset($data['proses']);
        unset($data['primary']);
        unset($data['primVal']);
        $primary = explode('##', $_POST['primary']);
        $primVal = explode('##', $_POST['primVal']);
        unset($primary['namabarang']);
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:setup_slave_kegiatan_norma.php

示例4: cleanData

    $Form->setError('error', 'Please write user password');
}
// Password
if (!isset($_POST['phone']) || empty($_POST['phone'])) {
    $Form->setError('error', 'Please write user phone number');
}
// Agency
if (!isset($_POST['agency']) || empty($_POST['agency'])) {
    $Form->setError('error', 'Please select a agency');
}
/**
 * Error Found!
 * Redirect back to form page
 */
if ($Form->num_errors > 0) {
    $Form->return_msg_to('add-a-user.php');
}
$first_name = cleanData($_POST['first_name']);
$last_name = cleanData($_POST['last_name']);
$email = cleanData($_POST['email']);
$password = cleanData($_POST['password']);
$phone = cleanData($_POST['phone']);
$agency = cleanData($_POST['agency']);
$userAdd = insertQuery(TBL_USER, array('type' => 'user', 'agency_id' => $agency, 'first_name' => $first_name, 'last_name' => $last_name, 'email' => $email, 'password' => $password, 'phone_no' => $phone, 'create_date' => 'NOW()'));
if (!$userAdd) {
    $Form->setError('error', 'Database error! Please try again.');
    $Form->return_msg_to('add-a-user.php');
} else {
    $Form->setError('success', 'New user added successfully');
    $Form->return_msg_to('user.php');
}
开发者ID:Dwetech,项目名称:Windowfreak1985,代码行数:31,代码来源:action_add_user.php

示例5: prosesAlokasi


//.........这里部分代码省略.........
                $akunpengguna = '';
                while ($bar = mysql_fetch_object($res)) {
                    $akunpengguna = $bar->akunhutang;
                }
                $akunsendiri = $intraco;
                if ($akunpengguna == '') {
                    exit("Error: Akun intraco  atau interco belum ada untuk unit " . $pengguna);
                }
            } else {
                $intern = true;
            }
        }
        if ($intern) {
            #proses data
            $kodeJurnal = $group;
            #======================== Nomor Jurnal =============================
            # Get Journal Counter
            $queryJ = selectQuery($dbname, 'keu_5kelompokjurnal', 'nokounter', "kodeorg='" . $_SESSION['org']['kodeorganisasi'] . "' and kodekelompok='" . $kodeJurnal . "' ");
            $tmpKonter = fetchData($queryJ);
            $konter = addZero($tmpKonter[0]['nokounter'] + 1, 3);
            # Transform No Jurnal dari No Transaksi
            $nojurnal = str_replace("-", "", $tanggal) . "/" . $_SESSION['empl']['lokasitugas'] . "/" . $kodeJurnal . "/" . $konter;
            #======================== /Nomor Jurnal ============================
            # Prep Header
            $dataRes['header'] = array('nojurnal' => $nojurnal, 'kodejurnal' => $kodeJurnal, 'tanggal' => $tanggal, 'tanggalentry' => date('Ymd'), 'posting' => 1, 'totaldebet' => $biaya[$key], 'totalkredit' => -1 * $biaya[$key], 'amountkoreksi' => '0', 'noreferensi' => 'ALK_KERJA_AB', 'autojurnal' => '1', 'matauang' => 'IDR', 'kurs' => '1', 'revisi' => '0');
            # Data Detail
            $noUrut = 1;
            # Debet
            $dataRes['detail'][] = array('nojurnal' => $nojurnal, 'tanggal' => $tanggal, 'nourut' => $noUrut, 'noakun' => $akunpekerjaan, 'keterangan' => $param['periode'] . ':Biaya Kendaraan ' . $param['kodevhc'], 'jumlah' => $biaya[$key], 'matauang' => 'IDR', 'kurs' => '1', 'kodeorg' => $_SESSION['empl']['lokasitugas'], 'kodekegiatan' => $kegiatan[$key], 'kodeasset' => $kodeasset[$key], 'kodebarang' => '', 'nik' => 0, 'kodecustomer' => '', 'kodesupplier' => '', 'noreferensi' => 'ALK_KERJA_AB', 'noaruskas' => '', 'kodevhc' => $param['kodevhc'], 'nodok' => '', 'kodeblok' => $lokasi[$key], 'revisi' => '0', 'kodesegment' => $segment[$key]);
            $noUrut++;
            # Kredit
            $dataRes['detail'][] = array('nojurnal' => $nojurnal, 'tanggal' => $tanggal, 'nourut' => $noUrut, 'noakun' => $akunalok, 'keterangan' => $param['periode'] . ':Alokasi biaya kend' . $param['kodevhc'], 'jumlah' => -1 * $biaya[$key], 'matauang' => 'IDR', 'kurs' => '1', 'kodeorg' => $_SESSION['empl']['lokasitugas'], 'kodekegiatan' => $kegiatan[$key], 'kodeasset' => '', 'kodebarang' => '', 'nik' => '0', 'kodecustomer' => '', 'kodesupplier' => '', 'noreferensi' => 'ALK_KERJA_AB', 'noaruskas' => '', 'kodevhc' => $param['kodevhc'], 'nodok' => '', 'kodeblok' => $lokasi[$key], 'revisi' => '0', 'kodesegment' => $segment[$key]);
            $noUrut++;
            $insHead = insertQuery($dbname, 'keu_jurnalht', $dataRes['header']);
            if (!mysql_query($insHead)) {
                $headErr .= 'Insert Header Intern Error : ' . mysql_error() . "\n";
            }
            if (empty($headErr)) {
                #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Insert Detail
                $detailErr = '';
                foreach ($dataRes['detail'] as $row) {
                    $insDet = insertQuery($dbname, 'keu_jurnaldt', $row);
                    if (!mysql_query($insDet)) {
                        $detailErr .= "Insert Detail Intern Error : " . mysql_error() . "\n";
                        break;
                    }
                }
                if ($detailErr == '') {
                    # Header and Detail inserted
                    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Update Kode Jurnal
                    $updJurnal = updateQuery($dbname, 'keu_5kelompokjurnal', array('nokounter' => $konter), "kodeorg='" . $_SESSION['org']['kodeorganisasi'] . "' and kodekelompok='" . $kodeJurnal . "'");
                    if (!mysql_query($updJurnal)) {
                        echo "Update Kode Jurnal Error : " . mysql_error() . "\n";
                        # Rollback if Update Failed
                        $RBDet = deleteQuery($dbname, 'keu_jurnalht', "nojurnal='" . $nojurnal . "'");
                        if (!mysql_query($RBDet)) {
                            echo "Rollback Delete Header Error : " . mysql_error() . "\n";
                            exit;
                        }
                        exit;
                    } else {
                    }
                } else {
                    echo $detailErr;
                    # Rollback, Delete Header
                    $RBDet = deleteQuery($dbname, 'keu_jurnalht', "nojurnal='" . $nojurnal . "'");
开发者ID:halimc17,项目名称:magsys,代码行数:67,代码来源:keu_slave_prosesAlokasiTraksi.php

示例6: array

     $data = array();
     if (is_array($_POST['data'])) {
         foreach ($_POST['data'] as $key => $row) {
             if ($_POST['jenis'] == 'po') {
                 $jumlah = $row['jumlah'];
                 $satuan = $row['satuan'];
             } elseif ($_POST['jenis'] == 'pl') {
                 $jumlah = 1;
                 $satuan = 'PETI';
             } else {
                 $jumlah = 0;
                 $satuan = $row['satuan'];
             }
             $data[] = array('nosj' => $_POST['nosj'], 'kodept' => $_POST['kodept'], 'kodebarang' => $row['kodebarang'], 'jenis' => strtoupper($_POST['jenis']), 'jumlah' => $jumlah, 'satuanpo' => $satuan, 'nopo' => isset($row['nopo']) ? $row['nopo'] : '', 'nopp' => isset($row['nopp']) ? $row['nopp'] : '', 'notransaksireferensi' => '', 'jumlahditerima' => 0);
         }
         $query = insertQuery($dbname, 'log_suratjalandt', $data);
         mysql_query($query) or die("Error DB: " . mysql_error());
     }
     break;
     // Save Detail
 // Save Detail
 case 'saveDetail':
     $where = "nosj='" . $param['nosj'] . "' and kodept='" . $param['kodept'] . "' and kodebarang='" . $param['kodebarang'] . "' and nopo='" . $param['nopo'] . "' and nopp='" . $param['nopp'] . "'";
     $cols = "*";
     $data = array('jumlah' => $param['jumlah']);
     if (isset($param['newNopo'])) {
         $data['nopo'] = $param['newNopo'];
         $data['nopp'] = $param['newNopp'];
     }
     $query = updateQuery($dbname, 'log_suratjalandt', $data, $where);
     mysql_query($query) or die("Error DB: " . mysql_error());
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:log_slave_suratjalan_detail.php

示例7: array

 case 'add':
     $cols = array('kodekegiatan', 'kodeorg', 'kodesegment', 'hasilkerja', 'jumlahhk', 'upahkerja', 'umr', 'upahpremi', 'notransaksi', 'tahuntanam', 'norma', 'statusblok', 'pekerjaanpremi', 'penalti1', 'penalti2', 'penalti3', 'penalti4', 'penalti5', 'nik');
     $data = $param;
     unset($data['numRow']);
     # Additional Default Data
     $data['tahuntanam'] = 0;
     $data['norma'] = 0;
     $data['statusblok'] = '0';
     $data['pekerjaanpremi'] = '0';
     $data['penalti1'] = 0;
     $data['penalti2'] = 0;
     $data['penalti3'] = 0;
     $data['penalti4'] = 0;
     $data['penalti5'] = 0;
     $data['nik'] = '-';
     $query = insertQuery($dbname, 'kebun_prestasi', $data, $cols);
     if (!mysql_query($query)) {
         echo "DB Error : " . mysql_error();
         exit;
     }
     unset($data['notransaksi']);
     unset($data['tahuntanam']);
     unset($data['norma']);
     unset($data['statusblok']);
     unset($data['pekerjaanpremi']);
     unset($data['penalti1']);
     unset($data['penalti2']);
     unset($data['penalti3']);
     unset($data['penalti4']);
     unset($data['penalti5']);
     unset($data['nik']);
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:kebun_slave_operasional_prestasi.php

示例8: simpanData


//.........这里部分代码省略.........
            if (count($nikbermasalah) > 0) {
                echo "Warning - The following nik on were not defined:<br>";
                echo "<pre>";
                print_r($nikbermasalah);
                echo "</pre>";
                $bermasalah = true;
            }
            if (count($absenbermasalah) > 0) {
                echo "Warning - The following absence on were not defined:<br>";
                echo "<pre>";
                print_r($absenbermasalah);
                echo "</pre>";
                $bermasalah = true;
            }
            if ($bermasalah == true) {
                exit;
            }
            // Get List Lokasi & Tanggal
            $lokTgl = array();
            foreach ($data as $key => $row) {
                if ($key > 0) {
                    $tmpLok = isset($dataSubbagian[$row[1]]) ? $dataSubbagian[$row[1]] : $dataLokasi[$row[1]];
                    $lokTgl[$tmpLok . $row[0]] = $tmpLok . $row[0];
                }
            }
            // Pool Data & Insert Header
            $dataD = array();
            foreach ($data as $key => $row) {
                if ($key > 0) {
                    foreach ($listAllLokasi as $lok) {
                        if (isset($lokTgl[$lok . $row[0]])) {
                            // Insert Header
                            $dataH = array('tanggal' => trim($row[0]), 'kodeorg' => $lok, 'periode' => $periode);
                            $qIns = insertQuery($dbname, 'sdm_absensiht', $dataH, array('tanggal', 'kodeorg', 'periode'));
                            // Execute, jika gagal skip
                            if (!mysql_query($qIns)) {
                                if (mysql_errno() != 1062) {
                                    exit("Insert Header Error: " . mysql_error());
                                }
                            }
                        }
                    }
                    $cekAbs = false;
                    if ($optTipe[$dataKaryId[trim($row[1])]] == 4) {
                        // Jika PHL, cek BKM
                        // Cek BKM Rawat
                        $qRawat = selectQuery($dbname, 'kebun_kehadiran_vw', '*', "karyawanid = '" . $dataKaryId[trim($row[1])] . "' and\n\t\t\t\t\t\t\t\t\t\t  tanggal = '" . trim($row[0]) . "'");
                        $resRawat = fetchData($qRawat);
                        if (!empty($resRawat)) {
                            $cekAbs = true;
                            break;
                        }
                        // Cek BKM Panen
                        $qPnn = selectQuery($dbname, 'kebun_prestasi_vw', '*', "karyawanid = '" . $dataKaryId[trim($row[1])] . "' and\n\t\t\t\t\t\t\t\t\t\t  tanggal = '" . trim($row[0]) . "'");
                        $resPnn = fetchData($qPnn);
                        if (!empty($resPnn)) {
                            $cekAbs = true;
                            break;
                        }
                    }
                    // Pool Detail
                    if (!$cekAbs) {
                        // Jika Belum ada di BKM
                        $org = isset($dataSubbagian[$row[1]]) ? $dataSubbagian[$row[1]] : $dataLokasi[$row[1]];
                        if ($dataLokasi[trim($row[1])] == substr($org, 0, 4)) {
                            $dataD[] = array('kodeorg' => $org, 'tanggal' => trim($row[0]), 'karyawanid' => $dataKaryId[trim($row[1])], 'shift' => trim($row[2]), 'absensi' => trim($row[3]), 'jam' => trim($row[4]), 'jamPlg' => trim($row[5]), 'penjelasan' => trim($row[6]), 'catu' => 0, 'penaltykehadiran' => 0, 'premi' => 0, 'insentif' => 0, 'fingerprint' => 1);
开发者ID:halimc17,项目名称:magsys,代码行数:67,代码来源:tool_slave_uploadData_12112015.php

示例9: userinfo

    $userinfo = "INSERT INTO userinfo (FK_users, dateOfBirth, gender, maritalSt, studies, InstitutionName, currentLocation, religion, photo)\r\n    VALUE ({$id}, '{$dateOfBirth}','{$gender}','{$maritalSt}','{$studies}','{$institution}','{$location}','{$religion}', '{$photo}');";
    mysql_query($userinfo) or die("Error in query: {$userinfo}. " . mysql_error());
}
insertUser(1, 'Daniel', 'Gimenez', 'dg', 1, '14-11-1940', 'Male', 'Single', 'University', 'UA', 'Argentina', 'Catholic', 'img08');
insertUser(2, 'Tomas', 'Alabes', 'ta', 1, '15-11-1945', 'Female', 'Single', 'University', 'UA', 'Argentina', 'Musulman', 'img08');
insertUser(3, 'Mariano', 'Claveria', 'mc', 1, '16-11-1988', 'Male', 'Single', 'University', 'UA', 'Argentina', 'Musulman', 'img08');
insertUser(4, 'Agustin', 'Miura', 'am', 1, '17-11-2002', 'Female', 'Single', 'University', 'UA', 'Argentina', 'Catholic', 'img08');
insertUser(5, 'Daniel', 'Grane', 'dag', 1, '20-11-1990', 'Male', 'Single', 'University', 'UA', 'Argentina', 'Catholic', 'img08');
insertUser(6, 'Damian', 'Minniti', 'dm', 1, '20-11-1990', 'Male', 'Single', 'University', 'UA', 'Argentina', 'Catholic', 'img08');
insertUser(7, 'Martin', 'Sanchez', 'ms', 1, '20-11-1990', 'Male', 'Single', 'University', 'UA', 'Argentina', 'Catholic', 'img08');
insertUser(8, 'Pablo', 'Celentano', 'pc', 1, '20-11-1990', 'Male', 'Single', 'University', 'UA', 'Argentina', 'Catholic', 'img08');
insertUser(9, 'Jorge', 'Gonzales', 'jg', 1, '20-11-1990', 'Male', 'Single', 'University', 'UA', 'Argentina', 'Catholic', 'img08');
insertUser(10, 'Pedro', 'Sorio', 'ps', 1, '20-11-1990', 'Male', 'Single', 'University', 'UA', 'Argentina', 'Catholic', 'img08');
// Insert query
$dates = array(getNextDate($phpdate), getNextDate($phpdate), getNextDate($phpdate), getNextDate($phpdate));
insertQuery(1, 'Chocolate', 1, $dates[2]);
insertAnswer(1, 1, 2);
insertAnswer(2, 1, 3);
insertAnswer(3, 1, 4);
insertAnswer(4, 1, 5);
insertQuestion(1, 'Do you like milka?', 1);
insertOption(1, 'Yes', 1, 1);
insertAnsOpt(1, 1, 1);
insertAnsOpt(2, 3, 1);
insertAnsOpt(7, 4, 1);
insertOption(2, 'No', 2, 1);
insertAnsOpt(3, 2, 2);
insertQuestion(2, 'How much do you like kinder eggs?', 1);
insertOption(3, 'Lot', 1, 2);
insertAnsOpt(4, 1, 3);
insertAnsOpt(5, 3, 3);
开发者ID:laiello,项目名称:qnet-ua2011,代码行数:31,代码来源:populate.php

示例10: tanggalsystem

     $data['nojurnal'] = tanggalsystem($data['tanggal']) . "/" . $_SESSION['empl']['lokasitugas'] . "/" . $data['kodejurnal'] . "/" . $counter;
     $nojur = $data['nojurnal'];
     #=============== Insert Process
     # Column
     $column = array('kodejurnal', 'tanggal', 'noreferensi', 'matauang', 'revisi', 'nojurnal', 'tanggalentry', 'posting', 'totaldebet', 'totalkredit', 'amountkoreksi', 'autojurnal', 'kurs');
     # Add Default Data
     $data['tanggal'] = tanggalsystem($data['tanggal']);
     $data['tanggalentry'] = date('Ymd');
     $data['posting'] = 0;
     $data['totaldebet'] = 0;
     $data['totalkredit'] = 0;
     $data['amountkoreksi'] = 0;
     $data['autojurnal'] = 0;
     $data['kurs'] = 0;
     # Query
     $query = insertQuery($dbname, 'keu_jurnalht', $data, $column);
     if (!mysql_query($query)) {
         echo "DB Error : " . mysql_error();
     } else {
         $updData = array('nokounter' => $tmpC);
         $query2 = updateQuery($dbname, 'keu_5kelompokjurnal', $updData, $whereNo);
         if (!mysql_query($query2)) {
             echo "DB Error : " . mysql_error();
         } else {
             echo $nojur;
         }
     }
     break;
 case 'edit':
     $data = $_POST;
     unset($data['nojurnal']);
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:keu_slave_jurnal_audit_header.php

示例11: checkPostGet

require_once 'master_validation.php';
require_once 'config/connection.php';
require_once 'lib/nangkoelib.php';
require_once 'lib/zLib.php';
require_once 'lib/fpdf.php';
require_once 'lib/terbilang.php';
$proses = $_GET['proses'];
$kodevhc = checkPostGet('kodevhc', '');
$kmhmakhir = checkPostGet('kmhmakhir', '');
switch ($proses) {
    case 'getKm':
        $qKm = selectQuery($dbname, 'vhc_kmhm_track', 'kmhmakhir', "kodevhc='" . $kodevhc . "'");
        $resKm = fetchData($qKm);
        if (empty($resKm)) {
            echo 0;
        } else {
            echo $resKm[0]['kmhmakhir'];
        }
        break;
    case 'reset':
        $dataIns = array($kodevhc, $kmhmakhir);
        $qIns = insertQuery($dbname, 'vhc_kmhm_track', $dataIns);
        if (!mysql_query($qIns)) {
            $dataUpd = array('kmhmakhir' => $kmhmakhir);
            $qUpd = updateQuery($dbname, 'vhc_kmhm_track', $dataUpd, "kodevhc='" . $kodevhc . "'");
            if (!mysql_query($qUpd)) {
                exit("Update KM/HM Error: " . mysql_error());
            }
        }
        break;
}
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:tool_slave_reset.php

示例12: mysql_query

 //exit("Error:$xCek");
 $ada = false;
 $yCek = mysql_query($xCek) or die(mysql_error());
 while ($zCek = mysql_fetch_assoc($yCek)) {
     $ada = true;
 }
 if ($ada == true) {
     echo "warning : data already exist ";
     exit;
 }
 // Input Budget BJR
 $optThnTnm = makeOption($dbname, 'setup_blok', 'kodeorg,tahuntanam', "kodeorg='" . $kdblok . "'");
 $dataIns = array('tahunbudget' => $thnbudget, 'kodeorg' => $kdblok, 'thntanam' => $optThnTnm[$kdblok], 'bjr' => $bjr, 'updateby' => $_SESSION['standard']['userid'], 'lastupdate' => date('Y-m-d H:i:s'), 'close' => 0);
 $dataUpd = array('bjr' => $bjr, 'updateby' => $_SESSION['standard']['userid'], 'lastupdate' => date('Y-m-d H:i:s'));
 $whereUpd = "tahunbudget='" . $thnbudget . "' and kodeorg='" . $kdblok . "' and thntanam='" . $optThnTnm[$kdblok] . "'";
 $insBjr = insertQuery($dbname, 'bgt_bjr', $dataIns);
 $updBjr = updateQuery($dbname, 'bgt_bjr', $dataUpd, $whereUpd);
 if (!mysql_query($insBjr)) {
     if (!mysql_query($updBjr)) {
         exit("DB Error: " . mysql_error());
     }
 }
 ##UNTUK VALIDASI TAHUN DI BJR
 // $iCek="select tahunbudget from ".$dbname.".bgt_bjr where tahunbudget='".$thnbudget."' ";
 // exit("Error:$xCek");
 // $ada=false;
 // $nCek=mysql_query($iCek)or die(mysql_error());
 // while($dCek=mysql_fetch_assoc($nCek))
 // {
 // $ada=true;
 // }
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:bgt_slave_prosuksi_kebun.php

示例13: mysql_error

         echo "DB Error : " . mysql_error();
     } else {
         // Delete Pajak
         $qDel = deleteQuery($dbname, 'log_spk_tax', "notransaksi='" . $param['notransaksi'] . "'");
         if (!mysql_query($qDel)) {
             exit("Delete Tax Error: " . mysql_error());
         } else {
             // Insert Detail Pajak
             $dataIns = array();
             print_r($param);
             foreach ($param['tax'] as $akun => $nilai) {
                 if ($nilai > 0) {
                     $dataIns[] = array('kodeorg' => $param['kodeorg'], 'notransaksi' => $param['notransaksi'], 'noakun' => $akun, 'nilai' => $nilai);
                 }
             }
             $qIns = insertQuery($dbname, 'log_spk_tax', $dataIns);
             echo $qIns;
             if (!mysql_query($qIns)) {
                 exit("Insert Tax Error: " . mysql_error());
             }
         }
     }
     break;
 case 'delete':
     //================periksa realisasi
     $m = 0;
     $strx = "select sum(jumlahrealisasi) from " . $dbname . ".log_baspk \n\t\t\t  where notransaksi='" . $param['notransaksi'] . "' and statusjurnal = '1'";
     $resx = mysql_query($strx);
     while ($barx = mysql_fetch_array($resx)) {
         $m = $barx[0];
     }
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:log_slave_spk.php

示例14: tanggalsystem

     }
     if ($warning != '') {
         echo "Warning :\n" . $warning;
         exit;
     }
     $data['tanggalberangkat'] = tanggalsystem($data['tanggalberangkat']);
     $data['tanggaltiba'] = tanggalsystem($data['tanggaltiba']);
     $data['tanggal'] = tanggalsystem($data['tanggal']);
     $data['penerima'] = 0;
     $data['tanggalterima'] = "0000-00-00";
     $data['postingby'] = 0;
     $cols = array();
     foreach ($data as $key => $row) {
         $cols[] = $key;
     }
     $query = insertQuery($dbname, 'log_konosemenht', $data, $cols);
     if (!mysql_query($query)) {
         echo "DB Error : " . mysql_error();
     }
     break;
     # Proses Edit Header
 # Proses Edit Header
 case 'edit':
     $data = $_POST;
     $where = "nokonosemen='" . $data['nokonosemen'] . "'";
     unset($data['nokonosemen']);
     $data['tanggal'] = tanggalsystem($data['tanggal']);
     $data['tanggaltiba'] = tanggalsystem($data['tanggaltiba']);
     $data['tanggalberangkat'] = tanggalsystem($data['tanggalberangkat']);
     $query = updateQuery($dbname, 'log_konosemenht', $data, $where);
     if (!mysql_query($query)) {
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:log_slave_konosemen.php

示例15: insertQuery

 //=====end tambahan ginting
 //        exit("qwe: ".$data['noakun']);
 //=====tambahan dz, fungsi cekAkun ada di lib/tanaman.php
 #periksa apakah akun hutang, dan jika akun hutang maka harus ada nik/pelanggan/supplier
 //        $nik=str_replace(" ","",$data['nik']);
 //        $kodesupplier=str_replace(" ","",$data['kodesupplier']);
 //        if(cekAkunSupplier($data['noakun']) and $kodesupplier=='')
 //        {
 //            exit("[ Error ]: Akun ".$data['noakun']." harus dilengkapi dengan kode/nama Supplier.");
 //        }
 //        if(cekAkunNik($data['noakun']) and $nik=='')
 //        {
 //            exit("[ Error ]: Akun ".$data['noakun']." harus dilengkapi dengan NIK/nama Karyawan.");
 //        }
 //=====end tambahan dz
 $query = insertQuery($dbname, 'keu_jurnaldt', $data, $cols);
 if (!mysql_query($query)) {
     echo "DB Error : " . mysql_error();
     exit;
 }
 unset($data['nojurnal']);
 unset($data['kodejurnal']);
 unset($data['tanggal']);
 unset($data['kodeorg']);
 $res = "";
 foreach ($data as $cont) {
     $res .= "##" . $cont;
 }
 $result = "{res:\"" . $res . "\",theme:\"" . $_SESSION['theme'] . "\"}";
 echo $result;
 break;
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:keu_slave_jurnal_manage_detail.php


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