function getImportExcelData($data, $fields)
{
    global $total_records, $cCharset, $columnIndex;
    foreach ($data->getWorksheetIterator() as $worksheet) {
        $highestRow = $worksheet->getHighestRow();
        for ($row = 2; $row <= $highestRow; ++$row) {
            for ($col = 0; $col < $columnIndex; ++$col) {
                $cell = $worksheet->getCellByColumnAndRow($col, $row);
                if (PHPExcel_Shared_Date::isDateTime($cell)) {
                    $date_format = $cell->getParent()->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode();
                    $value = PHPExcel_Style_NumberFormat::ToFormattedString($cell->getValue(), $date_format);
                    if ($value) {
                        $time = array();
                        if (strtotime($value)) {
                            $value = strtotime($value);
                        } else {
                            $d_format = "";
                            for ($i = 0; $i < strlen($date_format); $i++) {
                                $letter = substr(strtolower($date_format), $i, 1);
                                if ($letter == "d" || $letter == "m" || $letter == "y") {
                                    if (strpos($d_format, $letter) === false) {
                                        $d_format .= $letter;
                                    }
                                }
                            }
                            $value = strtotime(localdatetime2db($value, $d_format));
                        }
                        //							$value = PHPExcel_Shared_Date::ExcelToPHP($value);
                        $time = localtime($value, true);
                        $val = $time["tm_year"] + 1900 . "-" . ($time["tm_mon"] + 1) . "-" . $time["tm_mday"] . " " . $time["tm_hour"] . ":" . $time["tm_min"] . ":" . $time["tm_sec"];
                    } else {
                        $val = NULL;
                    }
                } else {
                    $error_handler = set_error_handler("empty_error_handler");
                    $val = PHPExcel_Shared_String::ConvertEncoding($cell->getValue(), $cCharset, 'UTF-8');
                    if ($error_handler) {
                        set_error_handler($error_handler);
                    }
                }
                $arr[$fields[$col]] = $val;
            }
            $ret = InsertRecord($arr, $row - 2);
            $total_records++;
        }
        break;
    }
}
Example #2
0
<?php

/* Include the Report writer scripts in the page security table
 */
InsertRecord('pagesecurity', array('script', 'security'), array('FormMaker.php', 1), array('script', 'security'), array('FormMaker.php', 1), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('ReportMaker.php', 1), array('script', 'security'), array('ReportMaker.php', 1), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('ReportCreator.php', 13), array('script', 'security'), array('ReportCreator.php', 13), $db);
UpdateDBNo(56, $db);
function ImportFromCSV($uploadfile)
{
    $ret = 1;
    global $error_message, $keys, $goodlines, $total_records, $conn, $strOriginalTableName, $keys_present, $auditObj;
    $fields = array();
    $fields = getImportCVSFields($uploadfile);
    // populate field names array
    for ($j = 0; $j < count($fields); $j++) {
        $fields[$j] = trim($fields[$j]);
        if (substr($fields[$j], 0, 1) == "\"" && substr($fields[$j], -1) == "\"") {
            $fields[$j] = substr($fields[$j], 1, -1);
        }
    }
    $fields = getFieldNamesByHeaders($fields);
    $keys_present = 1;
    for ($k = 0; $k < count($keys); $k++) {
        if (!in_array(RemoveFieldWrappers($keys[$k]), $fields)) {
            $keys_present = 0;
            break;
        }
    }
    $autoinc = false;
    if (in_array("Record ID", $fields)) {
        $autoinc = true;
    }
    if ($autoinc) {
        $sql = "SET IDENTITY_INSERT " . AddTableWrappers($strOriginalTableName) . " ON";
        db_exec($sql, $conn);
    }
    $total_records = 0;
    $line = "";
    $row = 0;
    // parse records from file
    if (($handle = fopen($uploadfile, "r")) !== FALSE) {
        while (($data = fgetcsv($handle, 1000000, ",")) !== FALSE) {
            // first rec contain only fields names
            if ($row === 0) {
                $row++;
                continue;
            }
            $arr = array();
            foreach ($data as $key => $val) {
                $type = GetFieldType($fields[$key]);
                if (IsDateFieldType($type)) {
                    $value = localdatetime2db($val);
                    if ($value !== -1 && $value !== FALSE && strlen($value)) {
                        $arr[$fields[$key]] = $value;
                    } else {
                        $arr[$fields[$key]] = NULL;
                    }
                } elseif (IsTimeType($type)) {
                    $value = localtime2db($val);
                    if ($value !== -1 && $value !== FALSE && strlen($value) && strlen($val) && !is_null($val)) {
                        $arr[$fields[$key]] = $value;
                    } else {
                        $arr[$fields[$key]] = NULL;
                    }
                } else {
                    $arr[$fields[$key]] = $val;
                }
            }
            $ret = InsertRecord($arr, $row);
            $row++;
        }
        fclose($handle);
    }
    $total_records = $row - 1;
    if ($autoinc) {
        $sql = "SET IDENTITY_INSERT " . AddTableWrappers($strOriginalTableName) . " OFF";
        db_exec($sql, $conn);
    }
    return $ret;
}
Example #4
0
File: 34.php Project: rrsc/KwaMoja
<?php

InsertRecord('mailgroups', array('id', 'groupname'), array(2, 'SalesAnalysisReportRecipients'), array('id', 'groupname'), array(2, 'SalesAnalysisReportRecipients'), $db);
NewScript('MailSalesReport_csv.php', '15', $db);
UpdateDBNo(basename(__FILE__, '.php'), $db);
Example #5
0
InsertRecord('chartmaster', array('accountcaode'), array('4430'), array('accountcode', 'accountname', 'group_'), array('4430', 'Verzend & Administratie', 'ANDERE INKOMSTEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('4440'), array('accountcode', 'accountname', 'group_'), array('4440', 'Rente', 'ANDERE INKOMSTEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('4450'), array('accountcode', 'accountname', 'group_'), array('4450', 'Foreign Exchange Gain', 'ANDERE INKOMSTEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5010'), array('accountcode', 'accountname', 'group_'), array('5010', 'Inkoopkosten algemeen', 'INKOOPPRIJS VERKOPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5020'), array('accountcode', 'accountname', 'group_'), array('5020', 'Inkoopkosten / Hardware', 'INKOOPPRIJS VERKOPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5030'), array('accountcode', 'accountname', 'group_'), array('5030', 'Inkoopkosten / Software', 'INKOOPPRIJS VERKOPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5040'), array('accountcode', 'accountname', 'group_'), array('5040', 'Inkoopkosten / Aftermarket Parts', 'INKOOPPRIJS VERKOPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5100'), array('accountcode', 'accountname', 'group_'), array('5100', 'Vrachtkosten', 'INKOOPPRIJS VERKOPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5410'), array('accountcode', 'accountname', 'group_'), array('5410', 'Salarissen', 'PERSONEELS KOSTEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5420'), array('accountcode', 'accountname', 'group_'), array('5420', 'EI Expense', 'PERSONEELS KOSTEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5430'), array('accountcode', 'accountname', 'group_'), array('5430', 'CPP Expense', 'PERSONEELS KOSTEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5440'), array('accountcode', 'accountname', 'group_'), array('5440', 'WCB Expense', 'PERSONEELS KOSTEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5470'), array('accountcode', 'accountname', 'group_'), array('5470', 'Employee Benefits', 'PERSONEELS KOSTEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5610'), array('accountcode', 'accountname', 'group_'), array('5610', 'Boekhouding- & Rechtkosten', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5615'), array('accountcode', 'accountname', 'group_'), array('5615', 'Reclame- & Promotiekosten', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5620'), array('accountcode', 'accountname', 'group_'), array('5620', 'Slechte Schulden', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5660'), array('accountcode', 'accountname', 'group_'), array('5660', 'Afschrijvingskosten', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5680'), array('accountcode', 'accountname', 'group_'), array('5680', 'Inkomsten Belastingen', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5685'), array('accountcode', 'accountname', 'group_'), array('5685', 'Verzekeringen', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5690'), array('accountcode', 'accountname', 'group_'), array('5690', 'Rente & Bankkosten', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5700'), array('accountcode', 'accountname', 'group_'), array('5700', 'Kantoorvoorzieningen', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5760'), array('accountcode', 'accountname', 'group_'), array('5760', 'Huurkosten', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5765'), array('accountcode', 'accountname', 'group_'), array('5765', 'Reparatie- & Onderhoudskosten', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5780'), array('accountcode', 'accountname', 'group_'), array('5780', 'Telefoonkosten', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5781'), array('accountcode', 'accountname', 'group_'), array('5781', 'Internetkosten', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5785'), array('accountcode', 'accountname', 'group_'), array('5785', 'Reis- & Vermaakkosten', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5790'), array('accountcode', 'accountname', 'group_'), array('5790', 'NUTS Kosten', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5795'), array('accountcode', 'accountname', 'group_'), array('5795', 'Registratie\'s', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5800'), array('accountcode', 'accountname', 'group_'), array('5800', 'Licenties', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5810'), array('accountcode', 'accountname', 'group_'), array('5810', 'Foreign Exchange Loss', 'GENERAL & ADMINISTRATIVE EXPEN'), $db);
Example #6
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('SalesCategoryPeriodInquiry.php', 1), array('script', 'security'), array('SalesCategoryPeriodInquiry.php', 1), $db);
UpdateDBNo(109, $db);
Example #7
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('SalesTopItemsInquiry.php', 1), array('script', 'security'), array('SalesTopItemsInquiry.php', 1), $db);
UpdateDBNo(108, $db);
Example #8
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('Z_ChangeSupplierCode.php', 15), array('script', 'security'), array('Z_ChangeSupplierCode.php', 15), $db);
UpdateDBNo(72, $db);
Example #9
0
InsertRecord('chartmaster', array('accountcaode'), array('2638'), array('accountcode', 'accountname', 'group_'), array('2638', 'Vilande utg', 'Moms och s'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2640'), array('accountcode', 'accountname', 'group_'), array('2640', 'Ing', 'Moms och s'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2641'), array('accountcode', 'accountname', 'group_'), array('2641', 'Debiterad ing', 'Moms och s'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2642'), array('accountcode', 'accountname', 'group_'), array('2642', 'Debiterad ing', 'Moms och s'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2645'), array('accountcode', 'accountname', 'group_'), array('2645', 'Ber', 'Moms och s'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2648'), array('accountcode', 'accountname', 'group_'), array('2648', 'Vilande ing', 'Moms och s'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2649'), array('accountcode', 'accountname', 'group_'), array('2649', 'Ing', 'Moms och s'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2650'), array('accountcode', 'accountname', 'group_'), array('2650', 'Redovisningskonto f', 'Moms och s'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2660'), array('accountcode', 'accountname', 'group_'), array('2660', 'S', 'Moms och s'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2661'), array('accountcode', 'accountname', 'group_'), array('2661', 'Reklamskatt', 'Moms och s'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2669'), array('accountcode', 'accountname', 'group_'), array('2669', '', 'Moms och s'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2710'), array('accountcode', 'accountname', 'group_'), array('2710', 'Personalens k', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2711'), array('accountcode', 'accountname', 'group_'), array('2711', 'Inneh', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2718'), array('accountcode', 'accountname', 'group_'), array('2718', 'Betald k', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2730'), array('accountcode', 'accountname', 'group_'), array('2730', 'Lagstadgade sociala avgifter och s', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2731'), array('accountcode', 'accountname', 'group_'), array('2731', 'Avr', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2732'), array('accountcode', 'accountname', 'group_'), array('2732', 'Avr', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2738'), array('accountcode', 'accountname', 'group_'), array('2738', 'Betalda lagstadgade sociala avgifter och s', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2740'), array('accountcode', 'accountname', 'group_'), array('2740', 'Avtalade sociala avgifter', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2741'), array('accountcode', 'accountname', 'group_'), array('2741', 'Avr', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2748'), array('accountcode', 'accountname', 'group_'), array('2748', 'Betalade avtalade sociala avgifter', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2750'), array('accountcode', 'accountname', 'group_'), array('2750', 'Utm', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2760'), array('accountcode', 'accountname', 'group_'), array('2760', 'Semesterkassa', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2790'), array('accountcode', 'accountname', 'group_'), array('2790', '', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2791'), array('accountcode', 'accountname', 'group_'), array('2791', 'Personalens intressekonto', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2792'), array('accountcode', 'accountname', 'group_'), array('2792', 'L', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2793'), array('accountcode', 'accountname', 'group_'), array('2793', 'Gruppf', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2794'), array('accountcode', 'accountname', 'group_'), array('2794', 'Fackf', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2795'), array('accountcode', 'accountname', 'group_'), array('2795', 'M', 'Personalens skatter, avgifter'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('3439'), array('accountcode', 'accountname', 'group_'), array('3439', 'F', 'Kortfristiga skulder till kred'), $db);
Example #10
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCRegister.php', 4), array('script', 'security'), array('KCMCRegister.php', 4), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCPatientDeposit.php', 4), array('script', 'security'), array('KCMCPatientDeposit.php', 4), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCRadiology.php', 4), array('script', 'security'), array('KCMCRadiology.php', 4), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCLabTests.php', 4), array('script', 'security'), array('KCMCLabTests.php', 4), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCPharmacy.php', 4), array('script', 'security'), array('KCMCPharmacy.php', 4), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCOtherMedicalServices.php', 4), array('script', 'security'), array('KCMCOtherMedicalServices.php', 4), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCInPatientBilling.php', 4), array('script', 'security'), array('KCMCInPatientBilling.php', 4), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCInsuranceInvoice.php', 4), array('script', 'security'), array('KCMCInsuranceInvoice.php', 4), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCRadiologyReport.php', 4), array('script', 'security'), array('KCMCRadiologyReport.php', 4), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCLaboratoryReport.php', 4), array('script', 'security'), array('KCMCLaboratoryReport.php', 4), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCInsuranceCompanyDetails.php', 4), array('script', 'security'), array('KCMCInsuranceCompanyDetails.php', 4), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCFunctionalUnitPL.php', 4), array('script', 'security'), array('KCMCFunctionalUnitPL.php', 4), $db);
UpdateDBNo(basename(__FILE__, '.php'), $db);
Example #11
0
File: 36.php Project: rrsc/KwaMoja
<?php

InsertRecord('mailgroups', array('id', 'groupname'), array(4, 'InventoryValuationRecipients'), array('id', 'groupname'), array(4, 'InventoryValuationRecipients'), $db);
UpdateDBNo(basename(__FILE__, '.php'), $db);
Example #12
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCAdmission.php', 1), array('script', 'security'), array('KCMCAdmission.php', 1), $db);
UpdateDBNo(84, $db);
Example #13
0
<?php

/* New report to hold the details of each users reportlets
 * that appear in the dashboard app
 */
CreateTable('reportlets', "CREATE TABLE `reportlets` (\n\t`userid` varchar(20) NOT NULL DEFAULT '',\n\t`id` varchar(50) NOT NULL DEFAULT '',\n\t`title` varchar(50) NOT NULL DEFAULT '',\n\t`refresh` int(11) NOT NULL DEFAULT 600,\n\tPRIMARY KEY  (`userid`, `id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8", $db);
InsertRecord('reportlets', array('userid', 'id', 'title'), array('admin', 'TopSalesVal', 'Top selling items by value'), array('userid', 'id', 'title', 'refresh'), array('admin', 'TopSalesVal', 'Top selling items by value', 60), $db);
InsertRecord('reportlets', array('userid', 'id', 'title'), array('admin', 'TopSalesQty', 'Top selling items by quantity'), array('userid', 'id', 'title', 'refresh'), array('admin', 'TopSalesQty', 'Top selling items by quantity', 60), $db);
InsertRecord('reportlets', array('userid', 'id', 'title'), array('admin', 'SalesGraph', 'Graph of last 12 months sales activity'), array('userid', 'id', 'title', 'refresh'), array('admin', 'SalesGraph', 'Graph of last 12 months sales activity', 60), $db);
UpdateDBNo(44, $db);
Example #14
0
<?php

InsertRecord('securitytokens', array('tokenid'), array('0'), array('tokenid, tokenname'), array('0', 'Main Index Page'), $db);
$result = DB_query("SELECT secroleid FROM securitygroups WHERE tokenid='0'", $db);
if (DB_num_rows($result) == 0) {
    DB_query("INSERT INTO securitygroups (SELECT secroleid, '0' FROM securityroles)", $db);
}
UpdateField('pagesecurity', 'security', 0, "script='Index.php'", $db);
UpdateDBNo(80, $db);
Example #15
0
InsertRecord('accountgroups', array('groupname'), array('Piutang Dagang'), array('groupname', 'sectioninaccounts', 'pandl', 'sequenceintb', 'parentgroupname'), array('Piutang Dagang', '10', '0', '20000', ''), $db);
InsertRecord('accountgroups', array('groupname'), array('Utang Dagang'), array('groupname', 'sectioninaccounts', 'pandl', 'sequenceintb', 'parentgroupname'), array('Utang Dagang', '20', '0', '30000', ''), $db);
InsertRecord('chartmaster', array('accountcaode'), array('1100'), array('accountcode', 'accountname', 'group_'), array('1100', 'Kas dan Bank IDR', 'Kas Bank'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('1200'), array('accountcode', 'accountname', 'group_'), array('1200', 'Mata Uang Asing', 'Kas Bank'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('1300'), array('accountcode', 'accountname', 'group_'), array('1300', 'Piutang Dagang/AR', 'Piutang Dagang'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('1410'), array('accountcode', 'accountname', 'group_'), array('1410', 'Inventory - Komponen', 'Inventory'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('1415'), array('accountcode', 'accountname', 'group_'), array('1415', 'Inventory - Perakitan Barang', 'Inventory'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('1501'), array('accountcode', 'accountname', 'group_'), array('1501', 'Uang Muka', 'Keuangan'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('1502'), array('accountcode', 'accountname', 'group_'), array('1502', 'Pajak Pembelian - VAT in', 'Aktiva Lain-lain'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('1599'), array('accountcode', 'accountname', 'group_'), array('1599', 'Transaksi Aktiva Tetap', 'Kas Bank'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('1700'), array('accountcode', 'accountname', 'group_'), array('1700', 'Akumulasi Penyusutan', 'Penyusutan'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2100'), array('accountcode', 'accountname', 'group_'), array('2100', 'Utang Dagang/AP', 'Utang Dagang'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2201'), array('accountcode', 'accountname', 'group_'), array('2201', 'Pembayaran Pajak', 'Kewajiban'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('2202'), array('accountcode', 'accountname', 'group_'), array('2202', 'Pembayaran Wajib', 'Kewajiban'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('3100'), array('accountcode', 'accountname', 'group_'), array('3100', 'Stok Awal', 'Modal'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('3200'), array('accountcode', 'accountname', 'group_'), array('3200', 'Stock Biasa', 'Modal'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('3400'), array('accountcode', 'accountname', 'group_'), array('3400', 'Laba ditahan', 'Modal'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('4100'), array('accountcode', 'accountname', 'group_'), array('4100', 'Penjualan', 'Pendapatan'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('4200'), array('accountcode', 'accountname', 'group_'), array('4200', 'Penjualan Kembali dan Diskon', 'Pendapatan'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5101'), array('accountcode', 'accountname', 'group_'), array('5101', 'Harga Pokok Penjualan', 'COGS'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5102'), array('accountcode', 'accountname', 'group_'), array('5102', 'Diskon Temin Pembelian', 'COGS'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('5103'), array('accountcode', 'accountname', 'group_'), array('5103', 'Ongkos Masuk', 'COGS'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('6100'), array('accountcode', 'accountname', 'group_'), array('6100', 'Beban Penjualan', 'Beban'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('6200'), array('accountcode', 'accountname', 'group_'), array('6200', 'Administrasi dan Beban Umum', 'Beban'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('6205'), array('accountcode', 'accountname', 'group_'), array('6205', 'Beban Penyusutan', 'Beban'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('6300'), array('accountcode', 'accountname', 'group_'), array('6300', 'Selisih Mata Uang Asing', 'Penjualan'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('7101'), array('accountcode', 'accountname', 'group_'), array('7101', 'Pendapatan Bunga Bank', 'Pendapatan Lain'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('7102'), array('accountcode', 'accountname', 'group_'), array('7102', 'Pendapatan Kas', 'Pendapatan Lain'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('8101'), array('accountcode', 'accountname', 'group_'), array('8101', 'Beban Administrasi Bank', 'Beban Lain-Lain'), $db);
InsertRecord('chartmaster', array('accountcaode'), array('8102'), array('accountcode', 'accountname', 'group_'), array('8102', 'Beban Bunga Bank', 'Beban Lain-Lain'), $db);
Example #16
0
InsertRecord('pagesecurity', array('script', 'security'), array('Z_ImportStocks.php', 15), array('script', 'security'), array('Z_ImportStocks.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_index.php', 15), array('script', 'security'), array('Z_index.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_MakeNewCompany.php', 15), array('script', 'security'), array('Z_MakeNewCompany.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_MakeStockLocns.php', 15), array('script', 'security'), array('Z_MakeStockLocns.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_poAddLanguage.php', 15), array('script', 'security'), array('Z_poAddLanguage.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_poAdmin.php', 15), array('script', 'security'), array('Z_poAdmin.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_poEditLangHeader.php', 15), array('script', 'security'), array('Z_poEditLangHeader.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_poEditLangModule.php', 15), array('script', 'security'), array('Z_poEditLangModule.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_poEditLangRemaining.php', 15), array('script', 'security'), array('Z_poEditLangRemaining.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_poRebuildDefault.php', 15), array('script', 'security'), array('Z_poRebuildDefault.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_PriceChanges.php', 15), array('script', 'security'), array('Z_PriceChanges.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_ReApplyCostToSA.php', 15), array('script', 'security'), array('Z_ReApplyCostToSA.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_RePostGLFromPeriod.php', 15), array('script', 'security'), array('Z_RePostGLFromPeriod.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_ReverseSuppPaymentRun.php', 15), array('script', 'security'), array('Z_ReverseSuppPaymentRun.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_SalesIntegrityCheck.php', 15), array('script', 'security'), array('Z_SalesIntegrityCheck.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_UpdateChartDetailsBFwd.php', 15), array('script', 'security'), array('Z_UpdateChartDetailsBFwd.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_Upgrade_3.01-3.02.php', 15), array('script', 'security'), array('Z_Upgrade_3.01-3.02.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_Upgrade_3.04-3.05.php', 15), array('script', 'security'), array('Z_Upgrade_3.04-3.05.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_Upgrade_3.05-3.06.php', 15), array('script', 'security'), array('Z_Upgrade_3.05-3.06.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_Upgrade_3.07-3.08.php', 15), array('script', 'security'), array('Z_Upgrade_3.07-3.08.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_Upgrade_3.08-3.09.php', 15), array('script', 'security'), array('Z_Upgrade_3.08-3.09.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_Upgrade_3.09-3.10.php', 15), array('script', 'security'), array('Z_Upgrade_3.09-3.10.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_Upgrade_3.10-3.11.php', 15), array('script', 'security'), array('Z_Upgrade_3.10-3.11.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_Upgrade3.10.php', 15), array('script', 'security'), array('Z_Upgrade3.10.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_Upgrade_3.11-4.00.php', 15), array('script', 'security'), array('Z_Upgrade_3.11-4.00.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_UploadForm.php', 15), array('script', 'security'), array('Z_UploadForm.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('Z_UploadResult.php', 15), array('script', 'security'), array('Z_UploadResult.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('ReportletContainer.php', 1), array('script', 'security'), array('ReportletContainer.php', 1), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('PageSecurity.php', 15), array('script', 'security'), array('PageSecurity.php', 15), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('UpgradeDatabase.php', 15), array('script', 'security'), array('UpgradeDatabase.php', 15), $db);
UpdateDBNo(45, $db);
Example #17
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('PDFQuotationPortrait.php', 2), array('script', 'security'), array('PDFQuotationPortrait.php', 2), $db);
UpdateDBNo(63, $db);
?>
~    
Example #18
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('config', array('confname', 'confvalue'), array('DispenseOnBill', '1'), array('confname', 'confvalue'), array('DispenseOnBill', '1'), $db);
UpdateDBNo(basename(__FILE__, '.php'), $db);
Example #19
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('MonthlyBankTransactions.php', 4), array('script', 'security'), array('MonthlyBankTransactions.php', 4), $db);
UpdateDBNo(basename(__FILE__, '.php'), $db);
Example #20
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('KCMCUnbilledItems.php', 1), array('script', 'security'), array('KCMCUnbilledItems.php', 1), $db);
UpdateDBNo(120, $db);
Example #21
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('GLJournalInquiry.php', 10), array('script', 'security'), array('GLJournalInquiry.php', 10), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('PDFGLJournal.php', 10), array('script', 'security'), array('PDFGLJournal.php', 10), $db);
UpdateDBNo(90, $db);
Example #22
0
InsertRecord('chartmaster', array('accountcode'), array('7641'), array('accountcode', 'accountname', 'group_'), array('7641', 'Shares in affiliated undertakings', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7642'), array('accountcode', 'accountname', 'group_'), array('7642', 'Amounts owed by affiliated undertakings', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7643'), array('accountcode', 'accountname', 'group_'), array('7643', 'Shares in undertakings linked by virtue of partici', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7644'), array('accountcode', 'accountname', 'group_'), array('7644', 'Amounts owed by undertakings linked by virtue of p', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7645'), array('accountcode', 'accountname', 'group_'), array('7645', 'Securities held as fixed assets', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7646'), array('accountcode', 'accountname', 'group_'), array('7646', 'Loans and debts receivable held as fixed assets', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7647'), array('accountcode', 'accountname', 'group_'), array('7647', 'Own shares/corporate units', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('765'), array('accountcode', 'accountname', 'group_'), array('765', 'Proceeds from disposal of debts receivable on fina', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7651'), array('accountcode', 'accountname', 'group_'), array('7651', 'Amounts owed by affiliated undertakings and undert', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7652'), array('accountcode', 'accountname', 'group_'), array('7652', 'Other debts receivable', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('768'), array('accountcode', 'accountname', 'group_'), array('768', 'Other extraordinary income', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7681'), array('accountcode', 'accountname', 'group_'), array('7681', 'Forfeits and penalties on purchases and sales', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7682'), array('accountcode', 'accountname', 'group_'), array('7682', 'Donations received', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7683'), array('accountcode', 'accountname', 'group_'), array('7683', 'Collection of debts receivable written off', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7684'), array('accountcode', 'accountname', 'group_'), array('7684', 'Extraordinary grants', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7685'), array('accountcode', 'accountname', 'group_'), array('7685', 'Surpluses resulting from escalation clauses', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7686'), array('accountcode', 'accountname', 'group_'), array('7686', 'Surpluses resulting from own shares and bonds boug', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('7688'), array('accountcode', 'accountname', 'group_'), array('7688', 'Other miscellaneous extraordinary income', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('769'), array('accountcode', 'accountname', 'group_'), array('769', 'Extraordinary provisions written back', 'Extraordinary income'));
InsertRecord('chartmaster', array('accountcode'), array('771'), array('accountcode', 'accountname', 'group_'), array('771', 'Corporate income tax assessments', 'Income tax adjustments'));
InsertRecord('chartmaster', array('accountcode'), array('772'), array('accountcode', 'accountname', 'group_'), array('772', 'Municipal business tax assessments', 'Income tax adjustments'));
InsertRecord('chartmaster', array('accountcode'), array('773'), array('accountcode', 'accountname', 'group_'), array('773', 'Foreign income tax assessments', 'Income tax adjustments'));
InsertRecord('chartmaster', array('accountcode'), array('779'), array('accountcode', 'accountname', 'group_'), array('779', 'Provisions for income taxes written back', 'Income tax adjustments'));
InsertRecord('chartmaster', array('accountcode'), array('7791'), array('accountcode', 'accountname', 'group_'), array('7791', 'Provisions for taxes written back', 'Income tax adjustments'));
InsertRecord('chartmaster', array('accountcode'), array('7792'), array('accountcode', 'accountname', 'group_'), array('7792', 'Provisions for deferred taxes written back', 'Income tax adjustments'));
InsertRecord('chartmaster', array('accountcode'), array('781'), array('accountcode', 'accountname', 'group_'), array('781', 'Net wealth tax assessments', 'Other tax adjustments'));
InsertRecord('chartmaster', array('accountcode'), array('782'), array('accountcode', 'accountname', 'group_'), array('782', 'Subscription tax assessments', 'Other tax adjustments'));
InsertRecord('chartmaster', array('accountcode'), array('783'), array('accountcode', 'accountname', 'group_'), array('783', 'Foreign taxes assessments', 'Other tax adjustments'));
InsertRecord('chartmaster', array('accountcode'), array('788'), array('accountcode', 'accountname', 'group_'), array('788', 'Other taxes assessments', 'Other tax adjustments'));
InsertRecord('chartmaster', array('accountcode'), array('789'), array('accountcode', 'accountname', 'group_'), array('789', 'Provisions for other taxes written back', 'Other tax adjustments'));
Example #23
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('Z_ChangeInsuranceCompanyCode.php', 1), array('script', 'security'), array('Z_ChangeInsuranceCompanyCode.php', 1), $db);
UpdateDBNo(121, $db);
Example #24
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('NoSalesItems.php', 4), array('script', 'security'), array('NoSalesItems.php', 4), $db);
UpdateDBNo(basename(__FILE__, '.php'), $db);
Example #25
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('doc/Manual/ManualContents.php', 1), array('script', 'security'), array('doc/Manual/ManualContents.php', 1), $db);
RenameTable('dispatch', 'stockrequest', $db);
RenameTable('dispatchitems', 'stockrequestitems', $db);
AddColumn('decimalplaces', 'stockrequestitems', 'int', 'not null', 0, 'quantity', $db);
AddColumn('uom', 'stockrequestitems', 'varchar(20)', 'not null', '', 'decimalplaces', $db);
ChangeColumnType('dispatchid', 'stockrequest', 'INT (11)', 'NOT NULL', 0, $db);
InsertRecord('systypes', array('typeid'), array('38'), array('typeid', 'typename', 'typeno'), array('38', 'Stock Requests', '0'), $db);
UpdateDBNo(97, $db);
Example #26
0
File: 35.php Project: rrsc/KwaMoja
<?php

InsertRecord('mailgroups', array('id', 'groupname'), array(3, 'OffersReceivedResultRecipients'), array('id', 'groupname'), array(3, 'OffersReceivedResultRecipients'), $db);
UpdateDBNo(basename(__FILE__, '.php'), $db);
Example #27
0
<p><input type="submit" name="CreateAccount" value="Create Account"></p>
</fieldset>
</form>
</div>
</body>
<?php 
include 'Connect.php';
$conn = connectDB('cardriverdata');
if (isset($_POST['CreateAccount'])) {
    $Name = $_POST['Name'];
    $UserId = $_POST['UserId'];
    $Email = $_POST['Email'];
    $password = $_POST['Password'];
    $validation_result = ValidateForm();
    //Validate the information
    $insertionresult = InsertRecord();
    //Insert Record
    if ($insertionresult === "true") {
        echo '<script>giveAlert("Success/Request for new account submitted successfully")</script>';
        //header('Location:http://localhost//Asset//index.php');
    } else {
        echo "<script>giveAlert('{$insertionresult}')</script>";
    }
}
//Inserts the record
function InsertRecord()
{
    global $name, $encrypted_password, $email, $mobileno, $conn;
    $empid = $_POST['EmpID'];
    $departmentid = $_POST['Department'];
    $designation = $_POST['Designation'];
Example #28
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('Departments.php', 11), array('script', 'security'), array('Departments.php', 11), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('StockTransfers_departments.php', 11), array('script', 'security'), array('StockTransfers_departments.php', 11), $db);
InsertRecord('pagesecurity', array('script', 'security'), array('PDFStockTransfer_departments.php', 11), array('script', 'security'), array('PDFStockTransfer_departments.php', 11), $db);
CreateTable('departments', "CREATE TABLE departments (\n`departmentid` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n`description` VARCHAR (100) NOT NULL DEFAULT '',\n`authoriser` varchar (20) NOT NULL DEFAULT ''\n) ENGINE=InnoDB DEFAULT CHARSET=utf8", $db);
CreateTable('dispatch', "CREATE TABLE dispatch (\n`dispatchid` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n`loccode` VARCHAR (5) NOT NULL DEFAULT '',\n`departmentid` INT NOT NULL DEFAULT 0,\n`despatchdate` DATE NOT NULL DEFAULT '0000-00-00',\n`authorised` TINYINT NOT NULL DEFAULT 0,\n`narrative` TEXT NOT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8", $db);
CreateTable('dispatchitems', "CREATE TABLE dispatchitems (\n`dispatchitemsid` INT NOT NULL DEFAULT 0,\n`dispatchid` INT NOT NULL DEFAULT 0,\n`stockid` VARCHAR (20) NOT NULL DEFAULT '',\n`quantity` DOUBLE NOT NULL DEFAULT 0\n) ENGINE=InnoDB DEFAULT CHARSET=utf8", $db);
UpdateDBNo(95, $db);
Example #29
0
<?php

/* Include the new script for printing quotations in Portrait
 */
InsertRecord('pagesecurity', array('script', 'security'), array('ConfirmProForma_Invoice.php', 2), array('script', 'security'), array('ConfirmProForma_Invoice.php', 2), $db);
InsertRecord('systypes', array('typeid'), array('13'), array('typeid', 'typename', 'typeno'), array('13', 'Proforma Invoices', '0'), $db);
CreateTable('proformatrans', "CREATE TABLE `proformatrans` (\n  `id` int(11) NOT NULL AUTO_INCREMENT,\n  `transno` int(11) NOT NULL DEFAULT '0',\n  `type` smallint(6) NOT NULL DEFAULT '0',\n  `stockid` varchar(20) NOT NULL DEFAULT '',\n  `debtorno` varchar(10) NOT NULL DEFAULT '',\n  `branchcode` varchar(10) NOT NULL DEFAULT '',\n  `trandate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n  `inputdate` datetime NOT NULL,\n  `prd` smallint(6) NOT NULL DEFAULT '0',\n  `settled` tinyint(4) NOT NULL DEFAULT '0',\n  `reference` varchar(20) NOT NULL DEFAULT '',\n  `tpe` char(2) NOT NULL DEFAULT '',\n  `order_` int(11) NOT NULL DEFAULT '0',\n  `rate` double NOT NULL DEFAULT '0',\n  `ovamount` double NOT NULL DEFAULT '0',\n  `ovgst` double NOT NULL DEFAULT '0',\n  `ovfreight` double NOT NULL DEFAULT '0',\n  `ovdiscount` double NOT NULL DEFAULT '0',\n  `diffonexch` double NOT NULL DEFAULT '0',\n  `alloc` double NOT NULL DEFAULT '0',\n  `invtext` text,\n  `shipvia` int(11) NOT NULL DEFAULT '0',\n  `edisent` tinyint(4) NOT NULL DEFAULT '0',\n  `consignment` varchar(15) NOT NULL DEFAULT '',\n  PRIMARY KEY (`id`),\n  KEY `DebtorNo` (`debtorno`,`branchcode`),\n  KEY `Order_` (`order_`),\n  KEY `Prd` (`prd`),\n  KEY `Tpe` (`tpe`),\n  KEY `Type` (`type`),\n  KEY `Settled` (`settled`),\n  KEY `TranDate` (`trandate`),\n  KEY `TransNo` (`transno`),\n  KEY `Type_2` (`type`,`transno`),\n  KEY `EDISent` (`edisent`),\n  CONSTRAINT `proformatrans_ibfk_2` FOREIGN KEY (`type`) REFERENCES `systypes` (`typeid`),\n  CONSTRAINT `proformatrans_ibfk_3` FOREIGN KEY (`prd`) REFERENCES `periods` (`periodno`),\n  CONSTRAINT `proformatrans_ibfk_4` FOREIGN KEY (`stockid`) REFERENCES `stockmaster` (`stockid`)\n) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8", $db);
UpdateDBNo(108, $db);
Example #30
0
File: 40.php Project: rrsc/KwaMoja
<?php

CreateTable('abcmethods', "CREATE TABLE `abcmethods` (\n\t`methodid` TINYINT NOT NULL DEFAULT 0,\n\t`methodname` VARCHAR(40) NOT NULL DEFAULT '',\n\tPRIMARY KEY (`methodid`)\n)", $db);
InsertRecord('abcmethods', array('methodid', 'methodname'), array(0, 'Consumption Value Ranking'), array('methodid', 'methodname'), array(0, 'Consumption Value Ranking'), $db);
CreateTable('abcgroups', "CREATE TABLE `abcgroups`(\n\t`groupid` INT(11) NOT NULL DEFAULT 0,\n\t`groupname` VARCHAR(40) NOT NULL DEFAULT '',\n\t`methodid` TINYINT NOT NULL DEFAULT 0,\n\t`apercentage` TINYINT NOT NULL DEFAULT 0,\n\t`bpercentage` TINYINT NOT NULL DEFAULT 0,\n\t`cpercentage` TINYINT NOT NULL DEFAULT 0,\n\t`zerousage` CHAR(1) NOT NULL DEFAULT 'D',\n\t`months` TINYINT NOT NULL DEFAULT 12,\n\tPRIMARY KEY (`groupid`),\n\tCONSTRAINT `abctgroups_ibfk_1` FOREIGN KEY (`methodid`) REFERENCES `abcmethods` (`methodid`)\n)", $db);
CreateTable('abcstock', "CREATE TABLE `abcstock` (\n\t`groupid` INT(11) NOT NULL DEFAULT 0,\n\t`stockid` VARCHAR(20) NOT NULL DEFAULT '',\n\t`abccategory` CHAR(1) NOT NULL DEFAULT 'C',\n\tPRIMARY KEY (`groupid`, `stockid`),\n\tCONSTRAINT `abcstock_ibfk_1` FOREIGN KEY (`groupid`) REFERENCES `abcgroups` (`groupid`),\n\tCONSTRAINT `abcstock_ibfk_2` FOREIGN KEY (`stockid`) REFERENCES `stockmaster` (`stockid`)\n)", $db);
NewScript('ABCRankingMethods.php', 15, $db);
NewScript('ABCRankingGroups.php', 15, $db);
NewScript('ABCRunAnalysis.php', 15, $db);
UpdateDBNo(basename(__FILE__, '.php'), $db);