public function prueba()
 {
     $conex = dbase_open('C:\\mficha.DBF', 0);
     //return dbase_get_header_info($conex);
     $total_registros = dbase_numrecords($conex);
     for ($i = 1; $i <= $total_registros; $i++) {
         echo dbase_get_record($conex, $i)[0] . '<br>';
     }
 }
Exemple #2
0
 function get_encabezado_llenado()
 {
     if ($this->dbf) {
         $numero_registros = dbase_numrecords($this->dbf);
         $this->tabla_sql_data = "INSERT INTO `" . $this->nombre_tabla . "` (\n" . $this->get_campos_str();
         for ($i = 1; $i <= $numero_registros; $i++) {
             $fila = dbase_get_record_with_names($this->dbf, $i);
             $control = 0;
             $this->tabla_sql_data .= "(";
             foreach ($fila as $key => $value) {
                 if ($control < count($fila) - 1) {
                     if ($this->campos[$control]['type'] === 'number') {
                         $this->tabla_sql_data .= $fila[$key];
                     } else {
                         $this->tabla_sql_data .= "'" . $fila[$key] . "'";
                     }
                     if ($control != count($fila) - 2) {
                         $this->tabla_sql_data .= ",";
                     } else {
                         $this->tabla_sql_data .= "),";
                     }
                 }
                 $control++;
             }
         }
         $cad = $this->tabla_sql_data;
         $this->tabla_sql_data = substr($cad, 0, -1);
         $this->tabla_sql_data .= ";";
     }
     //Fin IF Principal
 }
 public function postDailySales()
 {
     $dbf_file = $this->extracted_path . DS . 'CSH_AUDT.DBF';
     if (file_exists($dbf_file)) {
         $db = dbase_open($dbf_file, 0);
         $header = dbase_get_header_info($db);
         $record_numbers = dbase_numrecords($db);
         $last_ds = $this->ds->lastRecord();
         $update = 0;
         for ($i = 1; $i <= $record_numbers; $i++) {
             $row = dbase_get_record_with_names($db, $i);
             $vfpdate = vfpdate_to_carbon(trim($row['TRANDATE']));
             if (is_null($last_ds)) {
                 $attrs = ['date' => $vfpdate->format('Y-m-d'), 'branchid' => session('user.branchid'), 'managerid' => session('user.id'), 'sales' => $row['CSH_SALE'] + $row['CHG_SALE'], 'tips' => $row['TIP'], 'custcount' => $row['CUST_CNT'], 'empcount' => $row['CREW_KIT'] + $row['CREW_DIN']];
                 if ($this->ds->firstOrNew($attrs, ['date', 'branchid'])) {
                 }
                 $update++;
             } else {
                 if ($last_ds->date->lte($vfpdate)) {
                     $attrs = ['date' => $vfpdate->format('Y-m-d'), 'branchid' => session('user.branchid'), 'managerid' => session('user.id'), 'sales' => $row['CSH_SALE'] + $row['CHG_SALE'], 'tips' => $row['TIP'], 'custcount' => $row['CUST_CNT'], 'empcount' => $row['CREW_KIT'] + $row['CREW_DIN']];
                     if ($this->ds->firstOrNew($attrs, ['date', 'branchid'])) {
                     }
                     $update++;
                 }
             }
         }
         dbase_close($db);
         return count($update > 0) ? true : false;
     }
     return false;
 }
Exemple #4
0
 public function ListRead()
 {
     $count = dbase_numrecords($this->_dBase);
     for ($i = 1; $i <= $count; $i++) {
         $row = dbase_get_record_with_names($this->_dBase, $i);
     }
 }
 /**
  * Обновляет справочник банков, используя указанный файл или файл из папки data.
  *
  * Необходимо расширение dbase. Установить расширение dbase можно так: sudo pecl install dbase
  *
  * @param null $file
  * @return int
  */
 public function actionIndex($file = null)
 {
     if (!extension_loaded('dbase')) {
         $this->stdout("Для работы скрипта обновления необходимо установить расширение dbase\n", Console::FG_RED);
         return 1;
     }
     if ($file === null) {
         $file = Yii::getAlias(dirname(__FILE__) . '/../data/bnkseek.dbf');
     } else {
         $file = Yii::getAlias($file);
     }
     if (!file_exists($file)) {
         $this->stdout("Файл {$file} не найден!\n", Console::FG_RED);
         return 1;
     }
     if ($this->confirm("Обновить справочник банков России, используя файл {$file}?")) {
         $this->stdout('Выполняю обновление...' . "\n");
         $db = dbase_open($file, 0);
         if (!$db) {
             $this->stdout("Не удалось открыть файл как базу данный dbase!\n", Console::FG_RED);
             return 1;
         }
         $current_db_records_count = Bank::find()->count();
         $data_records_count = dbase_numrecords($db);
         $data_updated = false;
         $this->stdout("Количество банков в текущем справочнике - {$current_db_records_count}.\n");
         $this->stdout("Количество банков в файле - {$data_records_count}.\n");
         for ($i = 1; $i <= $data_records_count; $i++) {
             $rec = dbase_get_record_with_names($db, $i);
             /** @var Bank $model */
             $model = Yii::createObject(['class' => Bank::className(), 'bik' => $rec["NEWNUM"], 'okpo' => $rec["OKPO"], 'full_name' => iconv('CP866', 'utf-8', $rec["NAMEP"]), 'short_name' => iconv('CP866', 'utf-8', $rec["NAMEN"]), 'ks' => $rec["KSNP"], 'city' => iconv('CP866', 'utf-8', $rec["NNP"]), 'zip' => (int) $rec["IND"], 'address' => iconv('CP866', 'utf-8', $rec["ADR"]), 'tel' => iconv('CP866', 'utf-8', $rec["TELEF"])]);
             foreach ($model->getAttributes() as $key => $value) {
                 $model->{$key} = trim($value);
             }
             /** @var Bank $exist */
             $exist = Bank::findOne($model->bik);
             if (!$exist) {
                 $this->stdout("Добавлен новый банк: {$model->bik} {$model->short_name}\n");
                 $data_updated = true;
                 $model->save(false);
             } else {
                 if ($exist->getAttributes() != $model->getAttributes()) {
                     $exist->setAttributes($model->getAttributes());
                     $this->stdout("Обновлены данные банка: {$exist->bik} {$exist->short_name}\n");
                     $data_updated = true;
                     $exist->save(false);
                 }
             }
         }
         dbase_close($db);
         if ($data_updated) {
             $this->stdout('Справочник банков успешно обновлен!' . "\n", Console::FG_GREEN);
         } else {
             $this->stdout('В справочник банков не было внесено изменений.' . "\n", Console::FG_GREEN);
         }
     }
     return 0;
 }
 public function getNumeroRegistros()
 {
     $num = dbase_numrecords($this->conexao);
     if ($num != false) {
         return $num;
     } else {
         return false;
     }
 }
Exemple #7
0
 public function actionImportDbf($filename, $region = false)
 {
     $db = @dbase_open($filename, 0);
     if (!$db) {
         $this->stderr("Не удалось открыть DBF файл: '{$filename}'\n");
         return 1;
     }
     $classMap = ['/^.*DADDROBJ\\.DBF$/' => FiasDaddrobj::className(), '/^.*ADDROBJ\\.DBF$/' => FiasAddrobj::className(), '/^.*LANDMARK\\.DBF$/' => FiasLandmark::className(), '/^.*DHOUSE\\.DBF$/' => FiasDhouse::className(), '/^.*HOUSE\\d\\d\\.DBF$/' => FiasHouse::className(), '/^.*DHOUSINT\\.DBF$/' => FiasDhousint::className(), '/^.*HOUSEINT\\.DBF$/' => FiasHouseint::className(), '/^.*DLANDMRK\\.DBF$/' => FiasDlandmrk::className(), '/^.*DNORDOC\\.DBF$/' => FiasDnordoc::className(), '/^.*NORDOC\\d\\d\\.DBF$/' => FiasNordoc::className(), '/^.*ESTSTAT\\.DBF$/' => FiasDhousint::className(), '/^.*ACTSTAT\\.DBF$/' => FiasActstat::className(), '/^.*CENTERST\\.DBF$/' => FiasCenterst::className(), '/^.*ESTSTAT\\.DBF$/' => FiasEststat::className(), '/^.*HSTSTAT\\.DBF$/' => FiasHststat::className(), '/^.*OPERSTAT\\.DBF$/' => FiasOperstat::className(), '/^.*INTVSTAT\\.DBF$/' => FiasIntvstat::className(), '/^.*STRSTAT\\.DBF$/' => FiasStrstat::className(), '/^.*CURENTST\\.DBF$/' => FiasCurentst::className(), '/^.*SOCRBASE\\.DBF$/' => FiasSocrbase::className()];
     $modelClass = false;
     foreach ($classMap as $pattern => $className) {
         if (preg_match($pattern, $filename)) {
             $modelClass = $className;
             break;
         }
     }
     if ($modelClass === false) {
         $this->stderr("Не поддерживаемый DBF файл: '{$filename}'\n");
         return 1;
     }
     $rowsCount = dbase_numrecords($db);
     $this->stdout("Записей в DBF файле '{$filename}' : {$rowsCount}\n");
     $j = 0;
     for ($i = 1; $i <= $rowsCount; $i++) {
         $row = dbase_get_record_with_names($db, $i);
         if ($modelClass == FiasAddrobj::className() && $this->region && intval($row['REGIONCODE']) != intval($this->region)) {
             continue;
         }
         if ($j == 0) {
             $transaction = Yii::$app->db->beginTransaction();
         }
         $model = new $modelClass();
         foreach ($row as $key => $value) {
             if ($key == 'deleted') {
                 continue;
             }
             $key = strtolower($key);
             $model->{$key} = trim(mb_convert_encoding($value, 'UTF-8', 'CP866'));
         }
         $model->save();
         $j++;
         if ($j == 1000) {
             $transaction->commit();
             $j = 0;
             $this->stdout("Обработано {$i} из {$rowsCount} записей\n");
         }
     }
     if ($j != 0) {
         $transaction->commit();
     }
     return 0;
 }
function volcarDBF($db = "ctw10005")
{
    $results = array();
    $mFile = $db . date("Ymd") . ".txt";
    //Abrir el Archivo para Escribir
    $TFile = fopen(PATH_TMP . $mFile, "a");
    $pathdbase = CTW_PATH . vLITERAL_SEPARATOR . $db . ".dbf";
    //$db = dbase_open($ipdbase . $dirdbase . $nombredb . $db, 0);
    $rs = dbase_open($pathdbase, 0);
    //echo $pathdbase;
    $results[SYS_MSG] .= "Abrir {$pathdbase} <br />";
    $num_rows = dbase_numrecords($rs);
    //$o_num_rows = dbase_numrecords ($rs);
    if ($num_rows > 100000) {
        //$num_rows = 100000;				//Eliminar la Consulta a 50000
    }
    $results[SYS_MSG] .= "Numero de Filas {$num_rows} <br />";
    if (isset($rs)) {
        $results[SYS_MSG] .= "Cerrando " . dbase_get_header_info($rs) . " <br />";
        for ($i = 1; $i <= $num_rows; $i++) {
            //$field = dbase_get_record_with_names($rs, $i);
            $field = dbase_get_record($rs, $i);
            $lim = sizeof($field);
            $strW = "";
            for ($a = 0; $a < $lim; $a++) {
                if ($a == 0) {
                    $strW .= trim($field[$a]);
                } else {
                    $strW .= STD_LITERAL_DIVISOR . trim($field[$a]);
                }
            }
            $strW .= "\n";
            @fwrite($TFile, $strW);
            //if (dbase_delete_record ($rs, $i)) {
            // print "Registro $i Marcado para Eliminar de un total de $o_num_rows; se Busco $field[$key]. <br >";
            //break; # Exit the loop
            //}
        }
    } else {
        //dbase_get_header_info($rs);
    }
    //dbase_pack($rs);
    //$results[SYS_MSG] .= " <br />";
    dbase_close($rs);
    $results[SYS_MSG] .= "Cerrando {$pathdbase} <br />";
    fclose($TFile);
    $results[SYS_MSG] .= "Cerrando {$mFile} <br />";
    return $results;
}
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('<info>Started at ' . date('H:i:s') . '</info>');
        $em = $this->em = $this->getEntityManager('default');

        $this->truncate();

        $db_path = __DIR__ . '/../Resources/KLADR/STREET.DBF';
        $db = dbase_open($db_path, 0) or die("Error! Could not open dbase database file '$db_path'.");
        $record_numbers = dbase_numrecords($db);

        $batchSize = $input->getOption('batch');
        for ($i = 1; $i <= $record_numbers; $i++) {
            $row = dbase_get_record_with_names($db, $i);

            $street = new KladrStreet();
            $street->setTitle(trim(iconv('cp866', 'utf8', $row['NAME'])));

            $code = trim($row['CODE']);
            if(substr($code, -2) != '00')
                continue;

            $code = substr($code, 0, -2);
            $street->setId($code);
            $street->setParentCode(intval(str_pad(substr($code, 0, -4), 11, '0', STR_PAD_RIGHT)));

            $street->setZip(trim($row['INDEX']));
            $street->setOcatd(trim($row['OCATD']));
            $street->setSocr(trim(iconv('cp866', 'utf8', $row['SOCR'])));

            $em->persist($street);

            if (($i % $batchSize) == 0) {
                $em->flush();
                $em->clear();
                $output->writeln('<info>Inserted '. $i. ' records</info>');
            }
        }
        $em->flush();

        $output->writeln('<info>Inserted '. $i. ' records</info>');
        $output->writeln('<info>Success</info>');
        $output->writeln('<info>Deleting dead links</info>');
        $this->deleteNotLinkedElements();
        $output->writeln('<info>Assigning parents</info>');
        $this->updateParents();
        $output->writeln('<info>Success</info>');
    }
Exemple #10
0
function import_dbf($db, $table, $dbf_file)
{
    global $conn;
    if (!($dbf = dbase_open($dbf_file, 0))) {
        die("Could not open {$dbf_file} for import.");
    }
    $num_rec = dbase_numrecords($dbf);
    $num_fields = dbase_numfields($dbf);
    $fields = array();
    for ($i = 1; $i <= $num_rec; $i++) {
        $row = @dbase_get_record_with_names($dbf, $i);
        $q = "insert into {$db}.{$table} values (";
        foreach ($row as $key => $val) {
            if ($key == 'deleted') {
                continue;
            }
            $q .= "'" . addslashes(trim($val)) . "',";
            // Code modified to trim out whitespaces
        }
        if (isset($extra_col_val)) {
            $q .= "'{$extra_col_val}',";
        }
        $q = substr($q, 0, -1);
        $q .= ')';
        //if the query failed - go ahead and print a bunch of debug info
        if (!($result = mysql_query($q, $conn))) {
            print mysql_error() . " SQL: {$q}\n\n";
            print substr_count($q, ',') + 1 . " Fields total.\n\n";
            $problem_q = explode(',', $q);
            $q1 = "desc {$db}.{$table}";
            $result1 = mysql_query($q1, $conn);
            $columns = array();
            $i = 1;
            while ($row1 = mysql_fetch_assoc($result1)) {
                $columns[$i] = $row1['Field'];
                $i++;
            }
            $i = 1;
            foreach ($problem_q as $pq) {
                print "{$i} column: {$columns[$i]} data: {$pq}\n\n";
                $i++;
            }
            die;
        }
    }
}
Exemple #11
0
 function subedbff($file = 'TRABAJAD.DBF')
 {
     //nota:hay que modificar el upload_max_file_size=100M del php.ini
     //nota:cambiar el tamanano de pres.nacinal a 15 caracteres
     //nota:cambiar tamano de carg.descrip a tamano de 100
     set_time_limit(3600);
     $this->load->dbforge();
     $this->load->dbutil();
     $filea = explode('.', $file);
     $name = $filea[0];
     $ext = $filea[1];
     $uploadsdir = getcwd() . '/uploads/';
     $filedir = $uploadsdir . $file;
     $tabla = strtoupper($ext . $name);
     if (extension_loaded('dbase')) {
         $db = dbase_open($filedir, 0);
         $this->dbforge->drop_table($tabla);
         if ($db) {
             $cols = dbase_numfields($db);
             $rows = dbase_numrecords($db);
             $row = dbase_get_record_with_names($db, 10);
             foreach ($row as $key => $value) {
                 $fields[trim($key)] = array('type' => 'TEXT');
             }
             //print_r($fields);
             //exit();
             $this->dbforge->add_field($fields);
             $this->dbforge->create_table($tabla);
             $insert = array();
             for ($i = 0; $i <= $rows; $i++) {
                 $r = dbase_get_record_with_names($db, $i);
                 foreach ($row as $key => $value) {
                     $a = utf8_encode(trim($r[trim($key)]));
                     $insert[trim($key)] = $a;
                 }
                 $this->db->insert($tabla, $insert);
             }
             echo $i;
             dbase_close($db);
         } else {
             echo "No pudo abrir el archivo";
         }
     } else {
         echo 'Debe cargar las librerias dbase para poder usar este modulo';
     }
 }
Exemple #12
0
 public function load_dbf($filename, $mode = 0)
 {
     if (!file_exists($filename)) {
         return cy_dt(CYE_ERROR, 'Not a valid DBF file!');
     }
     $tail = substr($filename, -4);
     if (strcasecmp($tail, '.dbf') != 0) {
         return cy_dt(CYE_ERROR, 'Not a valid DBF file!');
     }
     try {
         $this->_handler = dbase_open($filename, $mode);
     } catch (Exception $e) {
         echo $e->getMessage();
         return cy_dt(CYE_ERROR, 'open DBF file failed!');
     }
     $this->field_num = dbase_numfields($this->_handler);
     $this->rec_num = dbase_numrecords($this->_handler);
     $this->field_names = dbase_get_header_info($this->_handler);
     return cy_dt(0);
 }
Exemple #13
0
 public function convert()
 {
     $delayed_objects = array();
     $num_records = dbase_numrecords($this->_link);
     for ($i = 1; $i <= $num_records; $i++) {
         $record = dbase_get_record($this->_link, $i);
         if ('skip_record' === ($obj = $this->_parseRecord($record))) {
             continue;
         }
         if ('delay_object' === $this->_insertObject($obj)) {
             $delayed_objects[] = $obj;
         }
     }
     foreach ($delayed_objects as $obj) {
         $this->_insertObject($obj, true);
     }
     //var_export($this->_region_abbrs);
     //var_export($this->_local_abbrs);
     return $this;
 }
Exemple #14
0
 public function fetch_all()
 {
     $rows = array();
     $record_numbers = dbase_numrecords($this->db);
     for ($i = 1; $i <= $record_numbers; $i++) {
         // do something here, for each record
         $row = dbase_get_record_with_names($this->db, $i);
         $rows[] = $row;
     }
     return $rows;
 }
<?php

error_reporting('-1');
$db = dbase_open('chart.dbf', 0);
if ($db) {
    $record_numbers = dbase_numrecords($db);
    for ($i = 1; $i <= $record_numbers; $i++) {
        $row = dbase_get_record_with_names($db, $i);
        foreach ($row as $key => $value) {
            echo $key . ': ' . $value . '<br/>';
        }
        //      echo print_r($row,true);
        //if ($row['ismember'] == 1) {
        //   echo "Member #$i: " . trim($row['name']) . "\n";
        //}
    }
}
?>

Exemple #16
0
 private function _setSize()
 {
     $this->_size = dbase_numrecords($this->_fp);
 }
Exemple #17
0
 function NumRec()
 {
     $ret = dbase_numrecords($this->DBFCon) or die("Gagal mengambil data");
     return $ret;
 }
Exemple #18
0
 /**
 * TODO create an AJAX call to give details of what will be done before it is done:
 * ie how many will be created, how many will be updated.
 * /
   public function upload_shp_check() {
   }
 
   /**
 * Controller action that performs the import of data in an uploaded Shapefile.
 * TODO Sort out how large geometries are displayed in the locations indicia page, and also other non
 * WGS84/OSGB srids.
 * TODO Add identification of record by external code as alternative to name.
 */
 public function upload_shp2()
 {
     $zipTempFile = $_POST['uploaded_zip'];
     $basefile = $_POST['extracted_basefile'];
     // at this point do I need to extract the zipfile again? will assume at the moment that it is
     // already extracted: TODO make sure the extracted files still exist
     ini_set('auto_detect_line_endings', 1);
     $view = new View('location/upload_shp2');
     $view->update = array();
     $view->create = array();
     $view->location_id = array();
     // create the file pointer, plus one for errors
     $count = 0;
     $this->template->title = "Confirm Shapefile upload for " . $this->pagetitle;
     $dbasedb = dbase_open($basefile . '.dbf', 0);
     if (!array_key_exists('name', $_POST)) {
         $this->setError('Upload problem', 'Name column in .dbf file must be specified.');
         return;
     }
     if (array_key_exists('use_parent', $_POST) && !array_key_exists('parent', $_POST)) {
         $this->setError('Upload problem', 'Parent column in .dbf file must be specified.');
         return;
     }
     if ($dbasedb) {
         // read some data ..
         $record_numbers = dbase_numrecords($dbasedb);
         $handle = fopen($basefile . '.shp', "rb");
         //Don't care about file header: jump direct to records.
         fseek($handle, 100, SEEK_SET);
         for ($i = 1; $i <= $record_numbers; $i++) {
             $row = dbase_get_record_with_names($dbasedb, $i);
             $location_name = $_POST['prepend'] . trim(utf8_encode($row[$_POST['name']]));
             $this->loadFromFile($handle);
             if (kohana::config('sref_notations.internal_srid') != $_POST['srid']) {
                 //convert to internal srid. First convert +/-90 to a value just off, as Google Maps doesn't cope with the poles!
                 $this->wkt = str_replace(array(' 90,', ' -90,', ' 90)', ' -90)'), array(' 89.99999999,', ' -89.99999999,', ' 89.99999999)', ' -89.99999999)'), $this->wkt);
                 $result = $this->db->query("SELECT ST_asText(ST_Transform(ST_GeomFromText('" . $this->wkt . "'," . $_POST['srid'] . ")," . kohana::config('sref_notations.internal_srid') . ")) AS wkt;")->current();
                 $this->wkt = $result->wkt;
             }
             if (array_key_exists('use_parent', $_POST)) {
                 //Ensure parent already exists and is unique  - no account of website taken...
                 $parent = trim($row[$_POST['parent']]);
                 $parentSelector = array_key_exists('use_parent_code', $_POST) ? 'code' : 'name';
                 $parent_locations = $this->findLocations(array($parentSelector => $parent));
                 if (count($parent_locations) == 0) {
                     $this->setError('Upload problem', "Could not find non deleted parent where {$parentSelector} = {$parent}");
                     return;
                 }
                 if (count($parent_locations) > 1) {
                     $this->setError('Upload problem', "Found more than one non deleted parent where {$parentSelector} = {$parent}");
                     return;
                 }
                 $parent_id = $parent_locations[0]->id;
             }
             if (isset($parent_id)) {
                 //Where there is a parent, look for existing child location with same name - no account of website taken...
                 $my_locations = ORM::factory('location')->where('name', $location_name)->where('parent_id', $parent_id)->where('deleted', 'false')->find_all();
                 if (count($my_locations) > 1) {
                     $this->setError('Upload problem', 'Found ' . count($my_locations) . ' non deleted children where name = ' . $location_name . " and parent {$parentSelector} = {$parent}");
                     return;
                 }
                 $myLocation = ORM::factory('location', array('name' => $location_name, 'parent_id' => $parent_id, 'deleted' => 'false'));
             } else {
                 $my_locations_args = array('name' => $location_name);
                 if (array_key_exists('type', $_POST)) {
                     $my_locations_args['location_type_id'] = $_POST['type'];
                 }
                 $my_locations = $this->findLocations($my_locations_args);
                 if (count($my_locations) > 1) {
                     $this->setError('Upload problem', 'Found more than one location where name = ' . $location_name);
                     return;
                 } elseif (count($my_locations) === 1) {
                     $myLocation = ORM::factory('location', $my_locations[0]->id);
                 } else {
                     $myLocation = ORM::factory('location');
                 }
             }
             if ($myLocation->loaded) {
                 // update existing record
                 if (array_key_exists('boundary', $_POST)) {
                     $myLocation->__set('boundary_geom', $this->wkt);
                     $myLocation->setCentroid(isset($_POST['use_sref_system']) && $_POST['use_sref_system'] && isset($_POST['srid']) && $_POST['srid'] != '' ? $_POST['srid'] : '4326');
                 } else {
                     $myLocation->__set('centroid_geom', $this->wkt);
                     $myLocation->__set('centroid_sref', $this->firstPoint);
                     $myLocation->__set('centroid_sref_system', $_POST['srid']);
                 }
                 $myLocation->save();
                 $description = $location_name . (isset($parent) ? ' - parent ' . $parent : '');
                 $view->update[] = $description;
                 $view->location_id[$description] = $myLocation->id;
             } else {
                 // create a new record
                 $fields = array('name' => array('value' => $location_name), 'deleted' => array('value' => 'f'), 'public' => array('value' => $_POST['website_id'] == 'all' ? 't' : 'f'));
                 if (array_key_exists('boundary', $_POST)) {
                     //centroid is calculated in Location_Model::preSubmit
                     $fields['boundary_geom'] = array('value' => $this->wkt);
                     if (isset($_POST['use_sref_system']) && $_POST['use_sref_system'] && isset($_POST['srid']) && $_POST['srid'] != '') {
                         $fields['centroid_sref_system'] = array('value' => $_POST['srid']);
                     }
                 } else {
                     $fields['centroid_geom'] = array('value' => $this->wkt);
                     $fields['centroid_sref'] = array('value' => $this->firstPoint);
                     $fields['centroid_sref_system'] = array('value' => $_POST['srid']);
                 }
                 if (array_key_exists('use_parent', $_POST)) {
                     $fields['parent_id'] = array('value' => $parent_id);
                 }
                 if (array_key_exists('code', $_POST)) {
                     $fields['code'] = array('value' => trim($row[$_POST['code']]));
                 }
                 if (array_key_exists('type', $_POST)) {
                     $fields['location_type_id'] = array('value' => $_POST['type']);
                 }
                 $save_array = array('id' => $myLocation->object_name, 'fields' => $fields, 'fkFields' => array(), 'superModels' => array());
                 if ($_POST['website_id'] != 'all') {
                     $save_array['joinsTo'] = array('website' => array($_POST['website_id']));
                 }
                 $myLocation->submission = $save_array;
                 $myLocation->submit();
                 $description = $location_name . (isset($parent) ? ' - parent ' . $parent : '');
                 $view->create[] = $description;
                 $view->location_id[$description] = $myLocation->id;
             }
         }
         fclose($handle);
         dbase_close($dbasedb);
     }
     kohana::log('debug', 'locations import done');
     $view->model = $this->model;
     $view->controllerpath = $this->controllerpath;
     $this->template->content = $view;
     $this->page_breadcrumbs[] = html::anchor($this->model->object_name, $this->pagetitle);
     $this->page_breadcrumbs[] = 'Setup SHP File upload';
 }
	update terakhir tgl. .............. -abrarhedar-
   ------------------------------------------------------
*/
session_start();
include "../lib/sambung.php";
include "../lib/sipl.php";
CheckAuthentication();
$kdunit = $_SESSION[kdunit];
$sktunit = strtolower(sktunitkerja($kdunit, $ta));
$ta = $_SESSION[ta];
$filedata = '../DataDipa/' . $sktunit . '/d_item.dbf';
if (file_exists($filedata)) {
    echo 'file ' . $filedata . ' ada';
    $data = dbase_open($filedata, 2);
    dbase_pack($data);
    $jml = dbase_numrecords($data);
    $vdataawal = dbase_get_record_with_names($data, 1);
    $tahun = $vdataawal["THANG"];
    $kodesatker = $vdataawal["KDSATKER"];
    //dbase_pack($data);
    $kdsatkerunit = kdsatker($kdunit);
    echo 'tahun anggaran ' . $tahun . ' satker data ' . $kodesatker;
    echo 'kode unit ' . $kdunit . ' satker unit ' . $kdsatkerunit;
    if ($_REQUEST['ok']) {
        mysql_query("delete from d_item where ThAng='{$ta}' and kdsatker='{$kdsatkerunit}' ");
        $i = 0;
        $no == 0;
        while ($i <= $jml) {
            $vdata = dbase_get_record_with_names($data, $i);
            $thang = $vdata["THANG"];
            $kdsatker = $vdata["KDSATKER"];
Exemple #20
0
     echo "<p><a href='import_absences_gep.php?id_classe={$id_classe}&amp;periode_num={$periode_num}&amp;step=3'>Cliquer ici </a> pour recommencer !</center></p>\n";
 } else {
     $tab_date = array();
     // on constitue le tableau des champs à extraire
     $tabchamps = array("ABSTYPE", "ELENOET", "ABSDATD", "ABSDATF", "ABSSEQD", "ABSSEQF", "ABSHEUR", "ABSJUST", "ABSMOTI", "ABSACTI");
     //ABSTYPE : Absence ou Retard ou Infirmerie
     //ELENOET : numéro de l'élève
     //ABSDATD : date de début de l'absence
     //ABSDATF : date de fin de l'absence
     //ABSSEQD : numéro de la séquence de début de l'absence
     //ABSSEQF : numéro de la séquence de fin de l'absence
     //ABSHEUR : heure de rentrée dans la cas d'un retard
     //ABSJUST : justification (Oui ou Non)
     //ABSMOTI : Motif
     //ABSACTI : ???? prend les valeurs suivantes AT, LE, CO, ... ?
     $nblignes = dbase_numrecords($fp);
     //number of rows
     $nbchamps = dbase_numfields($fp);
     //number of fields
     if (@dbase_get_record_with_names($fp, 1)) {
         $temp = @dbase_get_record_with_names($fp, 1);
     } else {
         echo "<p>Le fichier sélectionné n'est pas valide !<br />\n";
         echo "<a href='import_absences_gep.php?id_classe={$id_classe}&amp;periode_num={$periode_num}&amp;step=3'>Cliquer ici </a> pour recommencer !</center></p>\n";
         die;
     }
     $nb = 0;
     foreach ($temp as $key => $val) {
         $en_tete[$nb] = $key;
         $nb++;
     }
Exemple #21
0
                 $sql = "INSERT INTO d_akun VALUES ('" . $THANG . "', '" . $KDJENDOK . "', '" . $KDSATKER . "', '" . $KDDEPT . "', '" . $KDUNIT . "', '" . $KDPROGRAM . "', '" . $KDGIAT . "', '" . $KDOUTPUT . "', '" . $KDLOKASI . "', '" . $KDKABKOTA . "', '" . $KDDEKON . "', '" . $KDSOUTPUT . "', '" . $KDKMPNEN . "', '" . $KDSKMPNEN . "', '" . $KDAKUN . "', '" . $KDKPPN . "', '" . $KDBEBAN . "', '" . $KDJNSBAN . "', '" . $KDCTARIK . "', '" . $REGISTER . "', '" . $CARAHITUNG . "', '" . $PROSENPHLN . "', '" . $PROSENRKP . "', '" . $PROSENRMP . "', '" . $KPPNRKP . "', '" . $KPPNRMP . "', '" . $KPPNPHLN . "', '" . $REGDAM . "', '" . $KDLUNCURAN . "', '" . $KDIB . "')";
                 #echo $sql."<br>";
                 mysql_query($sql);
             }
             $i++;
         }
     }
 }
 if ($_FILES['pok']['name'] != "") {
     mysql_query("DELETE FROM d_item WHERE THANG = '" . $ta . "'");
     $filename = $_FILES['pok']['name'];
     $filedir = "dipa_files/" . $filename;
     move_uploaded_file($_FILES["pok"]["tmp_name"], $filedir);
     $data = dbase_open($filedir, 0);
     if ($data) {
         $ndata = dbase_numrecords($data);
         $i = 0;
         #THANG 	KDJENDOK 	KDSATKER 	KDDEPT 	KDUNIT 	KDPROGRAM 	KDGIAT 	KDOUTPUT 	KDLOKASI 	KDKABKOTA 10 	KDDEKON 	KDSOUTPUT 	KDKMPNEN 	KDSKMPNEN 	KDAKUN 	KDKPPN 	KDBEBAN 	KDJNSBAN 	KDCTARIK 	REGISTER 20 	CARAHITUNG 	HEADER1 	HEADER2 	KDHEADER 	NOITEM 	NMITEM 	VOL1 	SAT1 	VOL2 	SAT2 30 	VOL3 	SAT3 	VOL4 	SAT4 	VOLKEG 	SATKEG 	HARGASAT 	JUMLAH 	PAGUPHLN 	PAGURMP 40 	PAGURKP 	KDBLOKIR 	BLOKIRPHLN 	BLOKIRRMP 	BLOKIRRKP 	RPHBLOKIR 	KDCOPY 	KDABT 	KDSBU 	VOLSBK 50 	VOLRKAKL 	BLNKONTRAK 	NOKONTRAK 	TGKONTRAK 	NILKONTRAK 	JANUARI 	PEBRUARI 	MARET 	APRIL 	MEI 60 	JUNI 	JULI 	AGUSTUS 	SEPTEMBER 	OKTOBER 	NOPEMBER 	DESEMBER 	JMLTUNDA 	KDLUNCURAN 	JMLABT 70 	NOREV 	KDUBAH 	KURS 	INDEXKPJM 	KDIB
         while ($i <= $ndata) {
             $vdata = dbase_get_record_with_names($data, $i);
             $THANG = $vdata['THANG'];
             $KDJENDOK = $vdata['KDJENDOK'];
             $KDSATKER = $vdata['KDSATKER'];
             $KDDEPT = $vdata['KDDEPT'];
             $KDUNIT = $vdata['KDUNIT'];
             $KDPROGRAM = $vdata['KDPROGRAM'];
             $KDGIAT = $vdata['KDGIAT'];
             $KDOUTPUT = $vdata['KDOUTPUT'];
             $KDLOKASI = $vdata['KDLOKASI'];
             $KDKABKOTA = $vdata['KDKABKOTA'];
             $KDDEKON = $vdata['KDDEKON'];
Exemple #22
0
 function execute()
 {
     $toFix = false;
     $archiveDBFname = $this->path;
     $variables = new Variables();
     $MySQLconnect = new Connect($variables->dbHost, $variables->dbUser, $variables->dbPassword, $variables->dbName);
     if (!($DFBconnect = dbase_open($archiveDBFname, 0))) {
         //only reading
         return false;
     }
     //Connection to DBF error
     //get number of rows of dbf table
     $numRows = dbase_numrecords($DFBconnect);
     //get number of files of dbf table
     $numFields = dbase_numfields($DFBconnect);
     //the DBF registers begins with 1
     for ($x = 1; $x <= $numRows; $x++) {
         $DBFrow = dbase_get_record($DFBconnect, $x);
         //Get DBF archive rows
         $this->DB[$x - 1] = $DBFrow;
     }
     /*$host_ftp = "localhost";
     		$user_ftp = "root";
     		$pass_ftp = "";
     		
     		// Faz a conexão com o Servidor
     		$ftp_con = ftp_connect($host_ftp);
     		// Efetua o login com o usuário e senha informados
     		$ftp_log = ftp_login($ftp_con,$user_ftp,$pass_ftp);
     		
     		// Deleta o arquivo informado
     		if(!ftp_delete($ftp_con, $archiveDBFname))
     			die("ERRO CRITICO FTP!");
     		
     		// Encerramos a conexão de FTP previamente estabelecida
     		ftp_close($ftp_con);*/
     /*echo(decoct(777)."<br/>");
     		$temp = stat($archiveDBFname);
     		echo(octdec($temp["mode"])."<br/>");
     		echo(octdec(fileperms($archiveDBFname)));
     		if(!unlink($archiveDBFname))
     			die("ERRO CRITICO!");
     			
     		die("OK");*/
     //unlink($archiveDBFname)
     if (!$MySQLconnect->start()) {
         echo "Impossible to star connection in Handler.";
     }
     if (strlen($this->folhaType) > 0) {
         $row = mysql_fetch_assoc($MySQLconnect->execute("SELECT codigo_fol FROM Folhas where nome='{$this->folhaType}'"));
         $code = $row["codigo_fol"];
     }
     for ($x = 0; $x < $numRows; $x++) {
         switch ($this->tableId) {
             case "dcr":
                 $aux = array("INSERT INTO Cargos (cargo, descricao_cargo , tipo, vencimento) VALUES ('" . $this->DB[$x][0] . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][1])) . "', '" . $this->DB[$x][2] . "', " . $this->DB[$x][3] . ")");
                 break;
             case "dlt":
                 $aux = array("INSERT INTO Lotacoes (lotacao, descricao_lotacao , secretaria) VALUES ('" . $this->DB[$x][0] . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][1])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][2])) . "')");
                 break;
             case "especial":
                 $aux = array("INSERT INTO Especialidades (codigo_esp, descricao_especialidade , cargo) VALUES ('" . $this->DB[$x][0] . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][1])) . "', '" . $this->DB[$x][2] . "')");
                 break;
             case "eventos":
                 $aux = array("INSERT INTO Eventos (codigo_eve, descricao_evento, IRRF, IPMT, FAL, FIXO, TEMP, valor_eve, GRAT, FGTS, desconto, nivel_eve, INSS) VALUES ('" . $this->DB[$x][0] . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][1])) . "',  '" . $this->DB[$x][2] . "',  '" . $this->DB[$x][3] . "',  '" . $this->DB[$x][4] . "',  '" . $this->DB[$x][5] . "',  '" . $this->DB[$x][6] . "',  " . $this->DB[$x][7] . ",  '" . $this->DB[$x][8] . "',  '" . $this->DB[$x][9] . "',  " . $this->DB[$x][10] . ", '" . $this->DB[$x][11] . "', '" . $this->DB[$x][12] . "')");
                 break;
             case "cadastro":
                 $date = explode("-", $_SESSION["day"]);
                 $query = "SELECT * FROM Cadastros WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "' AND codigo_fol=" . $code;
                 $result = $MySQLconnect->execute($query);
                 $cont = $MySQLconnect->counterResult($result);
                 if ($code == 1) {
                     if ($cont > 0) {
                         $aux = array("UPDATE Cadastros SET cargo='" . $this->DB[$x][8] . "', lotacao='" . $this->DB[$x][1] . "', data_admissao='" . $this->dateFormater($this->DB[$x][4]) . "', vinculo='" . $this->DB[$x][5] . "', previdencia'" . $this->DB[$x][7] . "', nivel='" . $this->DB[$x][9] . "', dep_imp_re='" . $this->DB[$x][11] . "', hora_sem='" . $this->DB[$x][13] . "', instrucao='" . $this->DB[$x][14] . "', data_afastamento='" . $this->dateFormater($this->DB[$x][18]) . "', sindical='" . $this->DB[$x][19] . "', dp_sal_fam='" . $this->DB[$x][20] . "', hora_ponto='" . $this->DB[$x][21] . "', vale_transporte='" . $this->DB[$x][22] . "', data_promocao='" . $this->dateFormater($this->DB[$x][24]) . "', tipo='" . $this->DB[$x][27] . "', situacao='" . $this->DB[$x][28] . "', descontar='" . $this->DB[$x][29] . "', receber='" . $this->DB[$x][30] . "', funcao='" . $this->DB[$x][31] . "', maior_360='" . $this->DB[$x][33] . "', prof_40h='" . $this->DB[$x][34] . "', vlt_ver='" . $this->DB[$x][35] . "', val_niv=" . $this->valueFormater($this->DB[$x][36]) . ", data_FGTS='" . $this->dateFormater($this->DB[$x][37]) . "', permanente='" . $this->DB[$x][38] . "', remuneracao_bruto=" . $this->valueFormater($this->DB[$x][39]) . ", vencimento=" . $this->valueFormater($this->DB[$x][40]) . ", flag='" . $this->DB[$x][41] . "', entrada='" . $this->DB[$x][42] . "', liquido=" . $this->valueFormater($this->DB[$x][45]) . ", sobregrat='" . $this->DB[$x][46] . "', assistencia='" . $this->DB[$x][47] . "', medico='" . $this->DB[$x][48] . "', codigo_fol=" . $code . " WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "'", "UPDATE Pessoal SET nome='" . addslashes(zkl($this->xkey, $this->DB[$x][3])) . "', sexo='" . $this->DB[$x][12] . "', CPF='" . addslashes(zkl($this->xkey, $this->DB[$x][15])) . "', PIS_PASEP='" . addslashes(zkl($this->xkey, $this->DB[$x][16])) . "',  data_nascimento='" . $this->dateFormater($this->DB[$x][17]) . "', ultimo_nome='" . addslashes(zkl($this->xkey, $this->DB[$x][32])) . "', codigo_fol=" . $code . " WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "'", "UPDATE RG SET identidade='" . addslashes(zkl($this->xkey, $this->DB[$x][25])) . "', orgao_expedidor='" . addslashes(zkl($this->xkey, $this->DB[$x][26])) . "', codigo_fol=" . $code . " WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "'", "UPDATE Inf_Bancaria SET conta='" . addslashes(zkl($this->xkey, $this->DB[$x][6])) . "', banco='" . $this->DB[$x][43] . "',  numero='" . addslashes(zkl($this->xkey, $this->DB[$x][44])) . "' WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "' AND codigo_fol=" . $code . "");
                     } else {
                         $aux = array("INSERT INTO Cadastros (matricula, cargo, lotacao, data_admissao, vinculo, previdencia, nivel, dep_imp_re, hora_sem, instrucao, data_afastamento, sindical, dp_sal_fam, hora_ponto, vale_transporte, data_promocao, tipo, situacao, descontar, receber, funcao, maior_360, prof_40h, vlt_ver, val_niv, data_FGTS, permanente, remuneracao_bruto, vencimento, flag, entrada, liquido, sobregrat, assistencia, medico, senha, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . $this->DB[$x][8] . "', '" . $this->DB[$x][1] . "', '" . $this->dateFormater($this->DB[$x][4]) . "', '" . $this->DB[$x][5] . "', '" . $this->DB[$x][7] . "', '" . $this->DB[$x][9] . "', '" . $this->DB[$x][11] . "', '" . $this->DB[$x][13] . "', '" . $this->DB[$x][14] . "', '" . $this->dateFormater($this->DB[$x][18]) . "', '" . $this->DB[$x][19] . "', '" . $this->DB[$x][20] . "', '" . $this->DB[$x][21] . "', '" . $this->DB[$x][22] . "', '" . $this->dateFormater($this->DB[$x][24]) . "', '" . $this->DB[$x][27] . "', '" . $this->DB[$x][28] . "', '" . $this->DB[$x][29] . "', '" . $this->DB[$x][30] . "', '" . $this->DB[$x][31] . "', '" . $this->DB[$x][33] . "', '" . $this->DB[$x][34] . "', '" . $this->DB[$x][35] . "', " . $this->valueFormater($this->DB[$x][36]) . ", '" . $this->dateFormater($this->DB[$x][37]) . "', '" . $this->DB[$x][38] . "', " . $this->valueFormater($this->DB[$x][39]) . ", " . $this->valueFormater($this->DB[$x][40]) . ", '" . $this->DB[$x][41] . "', '" . $this->DB[$x][42] . "', " . $this->valueFormater($this->DB[$x][45]) . ", '" . $this->DB[$x][46] . "', '" . $this->DB[$x][47] . "', '" . $this->DB[$x][48] . "', '" . $this->passwordMaker() . "', " . $code . ")", "INSERT INTO Pessoal (matricula, nome, sexo, CPF, PIS_PASEP, data_nascimento, ultimo_nome, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][3])) . "', '" . $this->DB[$x][12] . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][15])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][16])) . "',  '" . $this->dateFormater($this->DB[$x][17]) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][32])) . "', " . $code . ")", "INSERT INTO RG (matricula, identidade, orgao_expedidor, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][25])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][26])) . "', " . $code . ")", "INSERT INTO Inf_Bancaria (matricula, conta, banco, numero, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][6])) . "', '" . $this->DB[$x][43] . "',  '" . addslashes(zkl($this->xkey, $this->DB[$x][44])) . "', " . $code . ")");
                     }
                 } else {
                     if ($code == 2) {
                         if ($cont > 0) {
                             $aux = array("UPDATE Cadastros SET cargo='" . $this->DB[$x][10] . "', lotacao='" . $this->DB[$x][1] . "', data_admissao='" . $this->dateFormater($this->DB[$x][4]) . "', vinculo='" . $this->DB[$x][5] . "', previdencia'" . $this->DB[$x][7] . "', nivel='" . $this->DB[$x][11] . "', dep_imp_re='" . $this->DB[$x][13] . "', hora_sem='" . addslashes(zkl($this->xkey, $this->DB[$x][15])) . "', instrucao='" . addslashes(zkl($this->xkey, $this->DB[$x][16])) . "', data_afastamento='" . $this->dateFormater($this->DB[$x][20]) . "', sindical='" . $this->DB[$x][21] . "', dp_sal_fam='" . $this->DB[$x][22] . "', hora_ponto='" . $this->DB[$x][23] . "', vale_transporte='" . $this->DB[$x][24] . "', data_promocao='" . $this->dateFormater($this->DB[$x][26]) . "', tipo='" . $this->DB[$x][29] . "', situacao='" . $this->DB[$x][30] . "', descontar='" . $this->DB[$x][31] . "', receber='" . addslashes(zkl($this->xkey, $this->DB[$x][32])) . "', funcao='" . $this->DB[$x][33] . "', maior_360='" . $this->DB[$x][35] . "', prof_40h='" . $this->DB[$x][36] . "', vlt_ver='" . $this->DB[$x][37] . "', val_niv=0, data_FGTS='" . $this->dateFormater($this->DB[$x][38]) . "', permanente='" . $this->DB[$x][40] . "', remuneracao_bruto=" . $this->valueFormater($this->DB[$x][39]) . ", vencimento=0, flag='" . $this->DB[$x][41] . "', entrada='" . $this->DB[$x][42] . "', liquido=" . $this->valueFormater($this->DB[$x][45]) . ", sobregrat='" . $this->DB[$x][8] . "', assistencia='" . $this->DB[$x][9] . "', medico='" . $this->DB[$x][46] . "', codigo_fol=" . $code . " WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "'", "UPDATE Pessoal SET nome='" . addslashes(zkl($this->xkey, $this->DB[$x][3])) . "', sexo='" . $this->DB[$x][14] . "', CPF='" . $this->DB[$x][17] . "', PIS_PASEP='" . $this->DB[$x][18] . "',  data_nascimento='" . $this->dateFormater($this->DB[$x][19]) . "', ultimo_nome='" . $this->DB[$x][34] . "', codigo_fol=" . $code . " WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "'", "UPDATE RG SET identidade='" . $this->DB[$x][27] . "', orgao_expedidor='" . $this->DB[$x][28] . "', codigo_fol=" . $code . " WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "'", "UPDATE Inf_Bancaria SET conta='" . addslashes(zkl($this->xkey, $this->DB[$x][6])) . "', banco='" . $this->DB[$x][43] . "',  numero='" . addslashes(zkl($this->xkey, $this->DB[$x][44])) . "' WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "' AND codigo_fol=" . $code . "");
                         } else {
                             $aux = array("INSERT INTO Cadastros (matricula, cargo, lotacao, data_admissao, vinculo, previdencia, nivel, dep_imp_re, hora_sem, instrucao, data_afastamento, sindical, dp_sal_fam, hora_ponto, vale_transporte, data_promocao, tipo, situacao, descontar, receber, funcao, maior_360, prof_40h, vlt_ver, val_niv, data_FGTS, permanente, remuneracao_bruto, vencimento, flag, entrada, liquido, sobregrat, assistencia, medico, senha, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . $this->DB[$x][10] . "', '" . $this->DB[$x][1] . "', '" . $this->dateFormater($this->DB[$x][4]) . "', '" . $this->DB[$x][5] . "', '" . $this->DB[$x][7] . "', '" . $this->DB[$x][11] . "', '" . $this->DB[$x][13] . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][15])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][16])) . "', '" . $this->dateFormater($this->DB[$x][20]) . "', '" . $this->DB[$x][21] . "', '" . $this->DB[$x][22] . "', '" . $this->DB[$x][23] . "', '" . $this->DB[$x][24] . "', '" . $this->dateFormater($this->DB[$x][26]) . "', '" . $this->DB[$x][29] . "', '" . $this->DB[$x][30] . "', '" . $this->DB[$x][31] . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][32])) . "', '" . $this->DB[$x][33] . "', '" . $this->DB[$x][35] . "', '" . $this->DB[$x][36] . "', '" . $this->DB[$x][37] . "', 0, '" . $this->dateFormater($this->DB[$x][38]) . "', '" . $this->DB[$x][40] . "', " . $this->valueFormater($this->DB[$x][39]) . ", 0, '" . $this->DB[$x][41] . "', '" . $this->DB[$x][42] . "', " . $this->valueFormater($this->DB[$x][45]) . ", '" . $this->DB[$x][8] . "', '" . $this->DB[$x][9] . "', '" . $this->DB[$x][46] . "', '" . $this->passwordMaker() . "', " . $code . ")", "INSERT INTO Pessoal (matricula, nome, sexo, CPF, PIS_PASEP, data_nascimento, ultimo_nome, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][3])) . "', '" . $this->DB[$x][14] . "', '" . $this->DB[$x][17] . "', '" . $this->DB[$x][18] . "',  '" . $this->dateFormater($this->DB[$x][19]) . "', '" . $this->DB[$x][34] . "', " . $code . ")", "INSERT INTO RG (matricula, identidade, orgao_expedidor, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . $this->DB[$x][27] . "', '" . $this->DB[$x][28] . "', " . $code . ")", "INSERT INTO Inf_Bancaria (matricula, conta, banco, numero, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][6])) . "', '" . $this->DB[$x][43] . "',  '" . addslashes(zkl($this->xkey, $this->DB[$x][44])) . "', " . $code . ")");
                         }
                     } else {
                         if ($code == 3) {
                             if ($cont > 0) {
                                 $aux = array("UPDATE Cadastros SET cargo='" . $this->DB[$x][8] . "', lotacao='" . $this->DB[$x][1] . "', data_admissao='" . $this->dateFormater($this->DB[$x][4]) . "', vinculo='" . $this->DB[$x][5] . "', previdencia'" . $this->DB[$x][7] . "', nivel='" . $this->DB[$x][9] . "', dep_imp_re='" . $this->DB[$x][11] . "', hora_sem='" . $this->DB[$x][13] . "', instrucao='" . $this->DB[$x][14] . "', data_afastamento='" . $this->dateFormater($this->DB[$x][18]) . "', sindical='" . $this->DB[$x][19] . "', dp_sal_fam='" . $this->DB[$x][20] . "', hora_ponto='" . $this->DB[$x][21] . "', vale_transporte='" . $this->DB[$x][22] . "', data_promocao='" . $this->dateFormater($this->DB[$x][24]) . "', tipo='" . $this->DB[$x][27] . "', situacao='" . $this->DB[$x][30] . "', descontar='" . $this->DB[$x][31] . "', receber='" . addslashes(zkl($this->xkey, $this->DB[$x][32])) . "', funcao='" . $this->DB[$x][33] . "', maior_360='" . $this->DB[$x][35] . "', prof_40h='" . $this->DB[$x][36] . "', vlt_ver='" . $this->DB[$x][37] . "', 0, data_FGTS='" . $this->dateFormater($this->DB[$x][44]) . "', permanente='" . $this->DB[$x][41] . "', remuneracao_bruto=" . $this->valueFormater($this->DB[$x][42]) . ", 0, 'z', 'z', liquido=" . $this->valueFormater($this->DB[$x][40]) . ", sobregrat='" . $this->DB[$x][43] . "', assistencia='" . $this->DB[$x][45] . "', 'z', codigo_fol=" . $code . " WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "'", "UPDATE Pessoal SET nome='" . addslashes(zkl($this->xkey, $this->DB[$x][3])) . "', sexo='" . $this->DB[$x][12] . "', CPF='" . addslashes(zkl($this->xkey, $this->DB[$x][15])) . "', PIS_PASEP='" . addslashes(zkl($this->xkey, $this->DB[$x][16])) . "',  data_nascimento='" . $this->dateFormater($this->DB[$x][17]) . "', ultimo_nome='" . $this->DB[$x][34] . "', codigo_fol=" . $code . " WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "'", "UPDATE RG SET identidade='" . addslashes(zkl($this->xkey, $this->DB[$x][25])) . "', orgao_expedidor='" . addslashes(zkl($this->xkey, $this->DB[$x][26])) . "', codigo_fol=" . $code . " WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "'", "UPDATE Inf_Bancaria SET conta='" . addslashes(zkl($this->xkey, $this->DB[$x][6])) . "', banco='" . $this->DB[$x][38] . "',  numero='" . $this->DB[$x][39] . "' WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "' AND codigo_fol=" . $code . "");
                             } else {
                                 $aux = array("INSERT INTO Cadastros (matricula, cargo, lotacao, data_admissao, vinculo, previdencia, nivel, dep_imp_re, hora_sem, instrucao, data_afastamento, sindical, dp_sal_fam, hora_ponto, vale_transporte, data_promocao, tipo, situacao, descontar, receber, funcao, maior_360, prof_40h, vlt_ver, val_niv, data_FGTS, permanente, remuneracao_bruto, vencimento, flag, entrada, liquido, sobregrat, assistencia, medico, senha, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . $this->DB[$x][8] . "', '" . $this->DB[$x][1] . "', '" . $this->dateFormater($this->DB[$x][4]) . "', '" . $this->DB[$x][5] . "', '" . $this->DB[$x][7] . "', '" . $this->DB[$x][9] . "', '" . $this->DB[$x][11] . "', '" . $this->DB[$x][13] . "', '" . $this->DB[$x][14] . "', '" . $this->dateFormater($this->DB[$x][18]) . "', '" . $this->DB[$x][19] . "', '" . $this->DB[$x][20] . "', '" . $this->DB[$x][21] . "', '" . $this->DB[$x][22] . "', '" . $this->dateFormater($this->DB[$x][24]) . "', '" . $this->DB[$x][27] . "', '" . $this->DB[$x][30] . "', '" . $this->DB[$x][31] . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][32])) . "', '" . $this->DB[$x][33] . "', '" . $this->DB[$x][35] . "', '" . $this->DB[$x][36] . "', '" . $this->DB[$x][37] . "', 0, '" . $this->dateFormater($this->DB[$x][44]) . "', '" . $this->DB[$x][41] . "', " . $this->valueFormater($this->DB[$x][42]) . ", 0, 'z', 'z', " . $this->valueFormater($this->DB[$x][40]) . ", '" . $this->DB[$x][43] . "', '" . $this->DB[$x][45] . "', 'z', '" . $this->passwordMaker() . "', " . $code . ")", "INSERT INTO Pessoal (matricula, nome, sexo, CPF, PIS_PASEP, data_nascimento, ultimo_nome, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][3])) . "', '" . $this->DB[$x][12] . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][15])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][16])) . "',  '" . $this->dateFormater($this->DB[$x][17]) . "', '" . $this->DB[$x][34] . "', " . $code . ")", "INSERT INTO RG (matricula, identidade, orgao_expedidor, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][25])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][26])) . "', " . $code . ")", "INSERT INTO Inf_Bancaria (matricula, conta, banco, numero, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][6])) . "', '" . $this->DB[$x][38] . "',  '" . $this->DB[$x][39] . "', " . $code . ")");
                             }
                         } else {
                             if ($code == 4) {
                                 if ($cont > 0) {
                                     $aux = array("UPDATE Cadastros SET cargo='" . $this->DB[$x][8] . "', lotacao='" . $this->DB[$x][1] . "', data_admissao='" . $this->dateFormater($this->DB[$x][4]) . "', vinculo='" . $this->DB[$x][5] . "', previdencia'" . $this->DB[$x][7] . "', nivel='" . $this->DB[$x][9] . "', dep_imp_re='" . $this->DB[$x][11] . "', hora_sem='" . $this->DB[$x][13] . "', instrucao='" . $this->DB[$x][14] . "', data_afastamento='" . $this->dateFormater($this->DB[$x][18]) . "', sindical='" . $this->DB[$x][19] . "', dp_sal_fam='" . $this->DB[$x][20] . "', hora_ponto='" . $this->DB[$x][21] . "', vale_transporte='" . $this->DB[$x][22] . "', data_promocao='" . $this->dateFormater($this->DB[$x][24]) . "', tipo='" . $this->DB[$x][27] . "', situacao='" . $this->DB[$x][28] . "', descontar='" . $this->DB[$x][29] . "', receber='" . $this->DB[$x][30] . "', funcao='" . $this->DB[$x][31] . "', maior_360='" . $this->DB[$x][33] . "', prof_40h='" . $this->DB[$x][34] . "', vlt_ver='" . $this->DB[$x][35] . "', 0, data_FGTS='" . $this->dateFormater($this->DB[$x][36]) . "', permanente='z', remuneracao_bruto=" . $this->valueFormater($this->DB[$x][44]) . ", vencimento=0, flag='z', entrada='" . $this->DB[$x][37] . "', liquido=" . $this->valueFormater($this->DB[$x][38]) . ", sobregrat='" . $this->DB[$x][41] . "', assistencia='" . $this->DB[$x][42] . "', medico='z', codigo_fol=" . $code . " WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "'", "UPDATE Pessoal SET nome='" . addslashes(zkl($this->xkey, $this->DB[$x][3])) . "', sexo='" . $this->DB[$x][12] . "', CPF='" . addslashes(zkl($this->xkey, $this->DB[$x][15])) . "', PIS_PASEP='" . addslashes(zkl($this->xkey, $this->DB[$x][16])) . "',  data_nascimento='" . $this->dateFormater($this->DB[$x][17]) . "', ultimo_nome='" . addslashes(zkl($this->xkey, $this->DB[$x][32])) . "', codigo_fol=" . $code . " WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "'", "UPDATE RG SET identidade='" . addslashes(zkl($this->xkey, $this->DB[$x][25])) . "', orgao_expedidor='" . addslashes(zkl($this->xkey, $this->DB[$x][26])) . "', codigo_fol=" . $code . " WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "'", "UPDATE Inf_Bancaria SET conta='" . addslashes(zkl($this->xkey, $this->DB[$x][6])) . "', banco='" . $this->DB[$x][39] . "',  numero='" . $this->DB[$x][40] . "' WHERE matricula='" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "' AND codigo_fol=" . $code . "");
                                 } else {
                                     $aux = array("INSERT INTO Cadastros (matricula, cargo, lotacao, data_admissao, vinculo, previdencia, nivel, dep_imp_re, hora_sem, instrucao, data_afastamento, sindical, dp_sal_fam, hora_ponto, vale_transporte, data_promocao, tipo, situacao, descontar, receber, funcao, maior_360, prof_40h, vlt_ver, val_niv, data_FGTS, permanente, remuneracao_bruto, vencimento, flag, entrada, liquido, sobregrat, assistencia, medico, senha, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . $this->DB[$x][8] . "', '" . $this->DB[$x][1] . "', '" . $this->dateFormater($this->DB[$x][4]) . "', '" . $this->DB[$x][5] . "', '" . $this->DB[$x][7] . "', '" . $this->DB[$x][9] . "', '" . $this->DB[$x][11] . "', '" . $this->DB[$x][13] . "', '" . $this->DB[$x][14] . "', '" . $this->dateFormater($this->DB[$x][18]) . "', '" . $this->DB[$x][19] . "', '" . $this->DB[$x][20] . "', '" . $this->DB[$x][21] . "', '" . $this->DB[$x][22] . "', '" . $this->dateFormater($this->DB[$x][24]) . "', '" . $this->DB[$x][27] . "', '" . $this->DB[$x][28] . "', '" . $this->DB[$x][29] . "', '" . $this->DB[$x][30] . "', '" . $this->DB[$x][31] . "', '" . $this->DB[$x][33] . "', '" . $this->DB[$x][34] . "', '" . $this->DB[$x][35] . "', 0, '" . $this->dateFormater($this->DB[$x][36]) . "', 'z', " . $this->valueFormater($this->DB[$x][44]) . ", 0, 'z', '" . $this->DB[$x][37] . "', " . $this->valueFormater($this->DB[$x][38]) . ", '" . $this->DB[$x][41] . "', '" . $this->DB[$x][42] . "', 'z', '" . $this->passwordMaker() . "', " . $code . ")", "INSERT INTO Pessoal (matricula, nome, sexo, CPF, PIS_PASEP, data_nascimento, ultimo_nome, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][3])) . "', '" . $this->DB[$x][12] . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][15])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][16])) . "',  '" . $this->dateFormater($this->DB[$x][17]) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][32])) . "', " . $code . ")", "INSERT INTO RG (matricula, identidade, orgao_expedidor, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][25])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][26])) . "', " . $code . ")", "INSERT INTO Inf_Bancaria (matricula, conta, banco, numero, codigo_fol) VALUES ('" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][6])) . "', '" . $this->DB[$x][39] . "',  '" . $this->DB[$x][40] . "', " . $code . ")");
                                 }
                             }
                         }
                     }
                 }
                 break;
             case "calculo":
                 $date = explode("-", $_SESSION["day"]);
                 $query = "SELECT * FROM Calculos WHERE matricula='" . $this->DB[$x][0] . "' AND fol_codigo=" . $code . " AND data BETWEEN '" . $date[2] . "-" . $date[1] . "-01' and '" . $date[2] . "-" . $date[1] . "-31' AND eve_codigo='" . $this->DB[$x][1] . "' AND valor='" . $this->valueFormater($this->DB[$x][2]) . "'";
                 $result = $MySQLconnect->execute($query);
                 if ($MySQLconnect->counterResult($result) > 0) {
                     $aux = array("UPDATE Calculos SET valor=" . $this->valueFormater($this->DB[$x][2]) . " WHERE matricula='" . $this->DB[$x][0] . "' AND fol_codigo=" . $code . " AND eve_codigo='" . $this->DB[$x][1] . "' AND data BETWEEN '" . $date[2] . "-" . $date[1] . "-01' and '" . $date[2] . "-" . $date[1] . "-31'");
                 } else {
                     $aux = array("INSERT INTO Calculos (valor, fol_codigo, eve_codigo, matricula, data) VALUES (" . $this->valueFormater($this->DB[$x][2]) . ", " . $code . ", '" . $this->DB[$x][1] . "', '" . addslashes(zkl($this->xkey, $this->DB[$x][0])) . "', '" . $this->dateFormater2($_SESSION["day"]) . "')");
                 }
                 break;
         }
         /*foreach($aux as $query){
         			echo $query."<br>";
         		}*/
         foreach ($aux as $query) {
             if (!$MySQLconnect->execute($query)) {
                 /*echo $query."<br>";
                 		die();*/
                 $toFix = true;
                 $this->DB[$x][$numFields] = "true";
             } else {
                 $this->DB[$x][$numFields] = "false";
             }
         }
     }
     //$MySQLconnect->close();
     dbase_close($DFBconnect);
     unlink($archiveDBFname);
     if ($toFix and $this->tableId != "cadastro" and $this->tableId != "calculo") {
         $this->fixProblems($numFields, $numRows);
     } else {
         header("Location: ../importDocuments.php?upl=true&tab={$this->tableId}");
     }
 }
<?php

include_once "sisfokampus.php";
HeaderSisfoKampus("Import NIDN Dosen");
$NamaFiledbf = "MSDOS.dbf";
$nmf = "file/{$NamaFiledbf}";
$tot = 0;
if (file_exists($nmf)) {
    $conn = dbase_open($nmf, 0);
    if ($conn) {
        $dbfrec = dbase_numrecords($conn);
        if ($dbfrec) {
            for ($i = 1; $i <= $dbfrec; $i++) {
                $row = dbase_get_record_with_names($conn, $i);
                $KTP = trim($row['NOKTPMSDOS']);
                $GELAR = trim($row['GELARMSDOS']);
                $TEMPATLAHIR = trim($row['TPLHRMSDOS']);
                $JABATAN = trim($row['KDJANMSDOS']);
                $JENJANG = trim($row['KDPDAMSDOS']);
                $STATUS = trim($row['KDSTAMSDOS']);
                $NIPPNS = trim($row['NIPNSMSDOS']);
                $INDUK = trim($row['PTINDMSDOS']);
                $DosenID = trim($row['NODOS_']);
                $s = "update dosen set \r\n\t\t\t\t\t\t\t\t\tKTP = '{$KTP}', Gelar='{$GELAR}', JabatanID='{$JABATAN}', JenjangID='{$JENJANG}',\r\n\t\t\t\t\t\t\t\t\tStatusKerjaID='{$STATUS}', NIPPNS='{$NIPPNS}', HomebaseInduk='{$INDUK}', TempatLahir='{$TEMPATLAHIR}'\r\n\t\t\t\t\t\t\t\t\twhere Login = '******'";
                $r = _query($s);
                echo $tot . "\n";
                $tot++;
            }
        } else {
            die("Gagal Membuka File DBF");
        }
Exemple #24
0
 function subedbf($file = 'DATONO02.DBF', $insertar = true)
 {
     set_time_limit(3600);
     $this->load->dbforge();
     $this->load->dbutil();
     $filea = explode('.', $file);
     $name = $filea[0];
     $ext = $filea[1];
     $uploadsdir = getcwd() . '/uploads/';
     $filedir = $uploadsdir . $file;
     $tabla = strtoupper($ext . $name);
     if (extension_loaded('dbase')) {
         $db = @dbase_open($filedir, 0);
         $this->dbforge->drop_table($tabla);
         if ($db) {
             $cols = @dbase_numfields($db);
             $rows = @dbase_numrecords($db);
             $row = @dbase_get_record_with_names($db, 10);
             print_r($row);
             count($row);
             if (is_array($row) > 0) {
                 foreach ($row as $key => $value) {
                     $fields[trim($key)] = array('type' => 'TEXT');
                 }
                 //print_r($fields);
                 //exit();
                 @$this->dbforge->add_field($fields);
                 @$this->dbforge->create_table($tabla);
                 if ($insertar) {
                     $insert = array();
                     for ($i = 0; $i <= $rows; $i++) {
                         $r = @dbase_get_record_with_names($db, $i);
                         foreach ($row as $key => $value) {
                             $a = @utf8_encode(trim($r[trim($key)]));
                             $insert[trim($key)] = $a;
                         }
                         @$this->db->insert($tabla, $insert);
                         echo 1;
                     }
                 }
                 @dbase_close($db);
             }
         } else {
             echo "No pudo abrir el archivo";
         }
     } else {
         echo 'Debe cargar las librerias dbase para poder usar este modulo';
     }
 }
Exemple #25
0
<?php

$db = false;
if (!empty($argc)) {
    $file = end($argv);
    $db = dbase_open($file, 0);
}
if ($db) {
    $iconvFrom = '866';
    $iconvTo = 'UTF-8';
    $delimetr = ',';
    $info = dbase_get_header_info($db);
    $fields = dbase_numfields($db);
    $fieldsCount = sizeof($fields);
    $records = dbase_numrecords($db);
    //for ($i = 1; $i <= 10; $i++) { # test
    for ($i = 1; $i <= $records; $i++) {
        $row = dbase_get_record($db, $i);
        $line = array();
        for ($j = 0; $j < $fields; $j++) {
            $line[] = addslashes(iconv($iconvFrom, $iconvTo, trim($row[$j])));
        }
        echo implode($delimetr, $line);
        echo PHP_EOL;
    }
    dbase_close($db);
}
Exemple #26
0
function aplod0()
{
    //$tahun = $_SESSION['tahun'];
    $Filedbf = $_FILES['nmf']['tmp_name'];
    $NamaFiledbf = $_FILES['nmf']['name'];
    $x = 0;
    $nmf = "autodebetup/{$NamaFiledbf}";
    if (move_uploaded_file($Filedbf, $nmf)) {
        if (file_exists($nmf)) {
            $conn = dbase_open($nmf, 0);
            if ($conn) {
                $dbfrec = dbase_numrecords($conn);
                if ($dbfrec) {
                    for ($i = 1; $i <= $dbfrec; $i++) {
                        $row = dbase_get_record_with_names($conn, $i);
                        $BPM = substr_replace($row['NOBPMTRINA'], '2007-', 0, 4);
                        $nobpm = GetaField('bayarmhsw', "BayarMhswID", $BPM, 'MhswID');
                        if (!empty($nobpm)) {
                            //var_dump($row['STATUTRINA']); exit;
                            $STATUS = trim($row['STATUTRINA']);
                            if ($STATUS == 'S') {
                                $x++;
                                $khsid = GetaField('khs', "TahunID = '{$row['THSMSTRINA']}' and MhswID", $row['NIMHSTRINA'], 'KHSID');
                                $_SESSION['BPT' . $x] = "{$row['NLHUTTRINA']}(30);{$row['NLDENTRINA']}(35);{$row['NLSEMTRINA']}(11);{$row['NLKOKTRINA']}(8);{$row['NLPRATRINA']}(6);{$row['NLSKSTRINA']}(5);{$row['NLSRITRINA']}(38)";
                                $_SESSION['ADUP' . $x] = "{$row['NIMHSTRINA']}~{$khsid}~{$BPM}~{$row['TAGIHTRINA']}~{$row['THSMSTRINA']}";
                            } else {
                            }
                        }
                    }
                    $_SESSION['ADUPPOS'] = 1;
                    $_SESSION['ADUPPOSX'] = $x;
                    echo "<p>File yang diupload akan diproses. Terdapat <b>{$x}</b> data yg akan diupload.</p>\r\n\t\t\t\t\t\t\t\t<p><IFRAME src='cetak/autodebet1.php?WZRD=aplod0' frameborder=0 height=300 width=300>\r\n\t\t\t\t\t\t\t\t</IFRAME></p>";
                }
            } else {
                echo ErrorMsg("Gagal Membuka file Autodebet", "File Autodebet gagal di buka, ulangi proses sekali lagi.");
            }
        } else {
            echo ErrorMsg("Proses Upload File DBF Gagal", "File gagal diupload. Coba ulangi sekali lagi.\r\n      <hr size=1>\r\n      Opsi: <a href='?mnux={$_SESSION['mnux']}'>Kembali</a>");
        }
    } else {
        $err = $_FILES['nmf']['error'][0];
        $nama = $_FILES['nmf']['name'];
        echo ErrorMsg("Gagal Upload", "File autodebet gagal diupload. File yg diupload: {$nama}. <br />\r\n    Pesan error: {$err}");
    }
}
 function _saveDBFData()
 {
     unset($this->DBFData["deleted"]);
     if ($this->recordNumber <= dbase_numrecords($this->DBFFile)) {
         if (!dbase_replace_record($this->DBFFile, array_values($this->DBFData), $this->recordNumber)) {
             $this->setError("I wasn't possible to update the information in the DBF file.");
         }
     } else {
         if (!dbase_add_record($this->DBFFile, array_values($this->DBFData))) {
             $this->setError("I wasn't possible to add the information to the DBF file.");
         }
     }
 }
Exemple #28
0
function verificaDBF($arq)
{
    if (function_exists("dbase_open")) {
        $db = dbase_open($arq, 0);
    } else {
        include_once dirname(__FILE__) . "/../pacotes/phpxbase/api_conversion.php";
        $db = xbase_open($arq, 0);
    }
    //nas vers&otilde;es novas do PHP open retorna vazio, n&atilde;o d&aacute; pra verificar
    //if ($db) {
    if (function_exists("dbase_numrecords")) {
        $record_numbers = dbase_numrecords($db);
        dbase_close($db);
    } else {
        $record_numbers = xbase_numrecords($db);
        xbase_close($db);
    }
    if ($record_numbers > 0) {
        return true;
    } else {
        return false;
    }
    //}
    //else {return false;}
}
Exemple #29
0
 /**
  * Gets the number of rows in a result set
  *
  * This method is not meant to be called directly.  Use
  * DB_result::numRows() instead.  It can't be declared "protected"
  * because DB_result is a separate object.
  *
  * @param resource $result  PHP's query result resource
  *
  * @return int  the number of rows.  A DB_Error object on failure.
  *
  * @see DB_result::numRows()
  */
 function numRows($foo)
 {
     return @dbase_numrecords($this->connection);
 }
Exemple #30
0
echo "<br>";
echo "xbase<br>";
echo "index = {$xi} <br>";
echo "header info: ";
print_r(xbase_get_header_info($xi));
dbase_close($di);
xbase_close($xi);
echo "<br><br>";
$di = dbase_open("test/xbase.dbf", 0);
$xi = xbase_open("test/dbase.dbf", 0);
echo "dbase<br>";
echo "index = {$di} <br>";
echo "column count = " . dbase_numfields($di) . " <br>";
echo "record count = " . dbase_numrecords($di) . " <br>";
echo "<table>";
for ($i = 0; $i < dbase_numrecords($di); $i++) {
    echo "<tr>";
    $r = dbase_get_record_with_names($di, $i + 1);
    foreach ($r as $c => $v) {
        echo "<td> {$c}={$v} </td>";
    }
    echo "</tr>";
}
echo "</table>";
echo "<br>";
echo "xbase<br>";
echo "index = {$xi} <br>";
echo "column count = " . xbase_numfields($xi) . " <br>";
echo "record count = " . xbase_numrecords($xi) . " <br>";
echo "<table>";
for ($i = 0; $i < xbase_numrecords($xi); $i++) {