コード例 #1
0
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                if ($THANG == $th) {
                    $sql = "INSERT INTO d_trktrm(THANG, KDSATKER, KDDEPT, KDUNIT, KDPROGRAM, KDGIAT, RPHPAGU, KDTRKTRM, JNSBELANJA, JML01, JML02, JML03, \r\n\t\t\t\t\t\tJML04, JML05, JML06, JML07, JML08, JML09, JML10, JML11, JML12) VALUES ('" . $THANG . "', '" . $KDSATKER . "', '" . $KDDEPT . "', '" . $KDUNIT . "', \r\n\t\t\t\t\t\t'" . $KDPROGRAM . "', '" . $KDGIAT . "', '" . $RPHPAGU . "', '" . $KDTRKTRM . "', '" . $JNSBELANJA . "', '" . $JML01 . "', '" . $JML02 . "', '" . $JML03 . "', \r\n\t\t\t\t\t\t'" . $JML04 . "', '" . $JML05 . "', '" . $JML06 . "', '" . $JML07 . "', '" . $JML08 . "', '" . $JML09 . "', '" . $JML10 . "', '" . $JML11 . "', '" . $JML12 . "')";
                    mysql_query($sql);
                }
            }
            $table_7->close();
        }
        $_SESSION['errmsg'] = "Proses Refresh data berhasil";
        ?>

			<meta http-equiv="refresh" content="0;URL=index.php?p=<?php 
        echo $p_next;
        ?>
"><?php 
        exit;
    }
}
?>

<style type="text/css">
	<!--
コード例 #2
0
ファイル: test_clone.php プロジェクト: edmarmoretti/i3geo
* Demonstration how to clone table meta-data to another and copy records
*
**/
/* load the required classes */
require_once "Column.class.php";
require_once "Record.class.php";
require_once "Table.class.php";
require_once "WritableTable.class.php";
/* open a template table object and read it */
$tableParent = new XBaseTable("test/bond.DBF");
$tableParent->open();
/* create a new table */
$tableNew = XBaseWritableTable::cloneFrom($tableParent);
$tableNew->openWrite("test/created.dbf", true);
while ($record = $tableParent->nextRecord()) {
    $tableNew->appendRecord();
    $tableNew->record->copyFrom($record);
    $tableNew->writeRecord();
}
$tableNew->close();
$tableParent->close();
/* open created file*/
$table = new XBaseTable("test/created.dbf");
$table->open();
/* xml output */
echo "<pre>\n";
echo htmlspecialchars($table->toXML());
echo "</pre>\n";
/* close the table */
$table->close();
コード例 #3
0
ファイル: queue.php プロジェクト: raymerta/Monev
 function execute($id)
 {
     $row = $this->db->from('tb_upload')->where('id', $id)->get()->row();
     $path = getcwd() . '/tmp/';
     $filename = $row->filename;
     if (!file_exists($path . DIRECTORY_SEPARATOR . $row->code)) {
         echo mkdir($path . DIRECTORY_SEPARATOR . $row->code);
     }
     $this->_extract($path . $filename, $path . $row->code);
     $dir = scandir($path . $row->code);
     //echo 'path : '.$path.'<br>';
     //echo 'filename : '.$filename.'<br>';
     //echo 'row code : '.$row->code.'<br>';
     //print_r($dir);
     require_once './prodigy-dbf.php';
     /* load the required classes */
     require_once "phpxbase/Column.class.php";
     require_once "phpxbase/Record.class.php";
     require_once "phpxbase/Table.class.php";
     $sql = $sql2 = '';
     $this->db->query('USE staging_monev');
     $nullflags = 0;
     //foreach ($dir as $v) {
     //echo count($dir);
     for ($i = 2; $i < count($dir); $i++) {
         $exploded = explode($row->code, $dir[$i]);
         //echo ' <br> dudi : '.$exploded[0];
         /* buat object table dan buka */
         if (substr($exploded[0], -3) != "FPT" && $exploded[0] != "t_versi.DBF") {
             $table = new XBaseTable('tmp/' . $row->code . '/' . $exploded[0] . $row->code);
             $table->open();
             /*Create table */
             $create_table = "create table if not exists " . $exploded[0] . " ( ";
             $fields = $table->getColumns();
             for ($t = 0; $t < count($fields); $t++) {
                 $j = count($fields) - 1;
                 switch ($fields[$i]->type) {
                     case "C":
                         $type = "char";
                         break;
                     case "N":
                         $type = "varchar";
                         break;
                 }
                 if ($t == $j) {
                     $create_table .= $fields[$t]->name . " " . $type . "(" . $fields[$t]->length . ") null ";
                 } else {
                     $create_table .= $fields[$t]->name . " " . $type . "(" . $fields[$t]->length . ") null, ";
                 }
             }
             $create_table .= ");";
             //echo $create_table;
             $this->db->query($create_table);
             //insert data of table X
             while ($record = $table->nextRecord()) {
                 //$field = $table->getColumns();
                 $data = $record->choppedData;
                 $value_of_field = "'" . $data[0] . "'";
                 for ($val = 1; $val < count($data); $val++) {
                     $value_of_field .= ",'" . $data[$val] . "'";
                 }
                 $sql = "INSERT INTO " . $exploded[0] . " VALUES ({$value_of_field});";
                 $this->db->query($sql);
                 //echo $sql;
             }
             //end while
             $table->close();
         }
     }
     $this->db->update('db_monev.tb_upload', array('is_done' => true), array('id' => $id));
     redirect(site_url() . 'backend/queue');
 }