Пример #1
0
 *  Month of report in YYYY-MM format. Defaults to previous month.
 * 
 */
date_default_timezone_set('America/New_York');
require "bdnindex.class.php";
/**
 * Establish the dates
 */
$reporting_period = strtotime($_GET["period"]) ? date("Y-m", strtotime($_GET['period'])) : date("Y-m", strtotime("-1 month"));
$file = "bdnindex/" . $reporting_period . '.json';
if ($_GET['b']) {
    $file = "b-data/" . $file;
}
$time_start = microtime(true);
// Is there a done file?
$data = readJSON($file);
/**
 * Look for a started file, since there is no done file.
 * If there is a started file, then read the PID from the started file.
 * Is it still live? Let the user know to wait.
 * Is it not alive? Run the script again (keep saving).
 * Output information to screen about what point we are at in the script.
 */
if (!$data) {
    // Look for a started file.
    $data = new bdnIndex($reporting_period);
    // Create a file to save the data when it's completed.
    $data->cache_date = date("Y-m-d H:i:s");
    file_put_contents($file, json_encode($data));
    dpr('Data written.');
    dpr('File status:' . is_readable($file));
Пример #2
0
<?php

error_reporting(0);
require_once 'helper.php';
$res = '';
$get_setting = readJSON('settingjson.cfg');
if (isset($_POST['save'])) {
    $target = $_POST['target'];
    $string = '{
"target": "' . $target . '",
"copyassets": "0"
}';
    $hasil_setting = createFile($string, 'settingjson.cfg');
    $res = '<p>Setting Updated</p>';
}
?>
<!doctype html>
<html>
    <head>
        <title>Harviacode Codeigniter CRUD Generator</title>
        <link rel="stylesheet" href="bootstrap.min.css"/>
        <style>
            body{
                padding: 15px;
            }
        </style>
    </head>
    <body>
        <div class="row">
            <div class="col-md-3">
                <?php 
Пример #3
0
 $v_read = $table_name . "_read";
 $v_form = $table_name . "_form";
 $v_doc = $table_name . "_doc";
 $v_pdf = $table_name . "_pdf";
 // url
 $c_url = strtolower($c);
 // filename
 $c_file = $c . '.php';
 $m_file = $m . '.php';
 $v_list_file = $v_list . '.php';
 $v_read_file = $v_read . '.php';
 $v_form_file = $v_form . '.php';
 $v_doc_file = $v_doc . '.php';
 $v_pdf_file = $v_pdf . '.php';
 // read setting
 $get_setting = readJSON('core/settingjson.cfg');
 $target = $get_setting->target;
 $pk = $hc->primary_field($table_name);
 $non_pk = $hc->not_primary_field($table_name);
 $all = $hc->all_field($table_name);
 // generate
 include 'core/create_config_pagination.php';
 include 'core/create_controller.php';
 include 'core/create_model.php';
 $jenis_tabel == 'reguler_table' ? include 'core/create_view_list.php' : (include 'core/create_view_list_datatables.php');
 include 'core/create_view_form.php';
 include 'core/create_view_read.php';
 $export_excel == 1 ? include 'core/create_exportexcel_helper.php' : '';
 $export_word == 1 ? include 'core/create_view_list_doc.php' : '';
 $export_pdf == 1 ? include 'core/create_pdf_library.php' : '';
 $export_pdf == 1 ? include 'core/create_view_list_pdf.php' : '';
Пример #4
0
function cancelRegistration($username, $seminarID)
{
    $seminars = getSeminars();
    $attendee_list = readJSON("seminar_attendees.json");
    $datetime = $seminars[$seminarID]['datetime'];
    if (in_array($username, $attendee_list['attendees'][$seminarID][$datetime])) {
        $key = array_search($username, $attendee_list['attendees'][$seminarID][$datetime]);
        unset($attendee_list['attendees'][$seminarID][$datetime][$key]);
        modifyJSON("seminar_attendees.json", $attendee_list);
    }
}