コード例 #1
0
ファイル: zone.php プロジェクト: htom78/XZB2c
 private static function loadItems()
 {
     self::$_items = array();
     $models = self::model()->findAll();
     foreach ($models as $model) {
         self::$_items[$model->zone_ID] = $model->name;
     }
 }
コード例 #2
0
ファイル: ZoneController.php プロジェクト: htom78/XZB2c
 public function loadModel()
 {
     if ($this->_model == null) {
         if (isset($_GET['id'])) {
             $condition = '';
             $this->_model = zone::model()->findByPk($_GET['id'], $condition);
         }
         if ($this->_model == null) {
             throw new CHttpException(404, "The requested page does not exist!");
         }
     }
     return $this->_model;
 }
コード例 #3
0
ファイル: add_zone.php プロジェクト: seans888/Bgy-Project
<?php

//****************************************************************************************
//Generated by Cobalt, a rapid application development framework. http://cobalt.jvroig.com
//Cobalt developed by JV Roig (jvroig@jvroig.com)
//****************************************************************************************
require 'path.php';
init_cobalt('Add zone');
require 'components/get_listview_referrer.php';
if (xsrf_guard()) {
    init_var($_POST['btn_cancel']);
    init_var($_POST['btn_submit']);
    require 'components/query_string_standard.php';
    require 'subclasses/zone.php';
    $dbh_zone = new zone();
    $object_name = 'dbh_zone';
    require 'components/create_form_data.php';
    extract($arr_form_data);
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button');
        redirect("listview_zone.php?{$query_string}");
    }
    if ($_POST['btn_submit']) {
        log_action('Pressed submit button');
        $message .= $dbh_zone->sanitize($arr_form_data)->lst_error;
        extract($arr_form_data);
        if ($dbh_zone->check_uniqueness($arr_form_data)->is_unique) {
            //Good, no duplicate in database
        } else {
            $message = "Record already exists with the same primary identifiers!";
        }
コード例 #4
0
ファイル: delete_zone.php プロジェクト: seans888/Bgy-Project
require 'path.php';
init_cobalt('Delete zone');
if (isset($_GET['zone_id'])) {
    $zone_id = urldecode($_GET['zone_id']);
    require_once 'form_data_zone.php';
}
if (xsrf_guard()) {
    init_var($_POST['btn_cancel']);
    init_var($_POST['btn_delete']);
    require 'components/query_string_standard.php';
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button');
        redirect("listview_zone.php?{$query_string}");
    } elseif ($_POST['btn_delete']) {
        log_action('Pressed delete button');
        require_once 'subclasses/zone.php';
        $dbh_zone = new zone();
        $object_name = 'dbh_zone';
        require 'components/create_form_data.php';
        $dbh_zone->delete($arr_form_data);
        redirect("listview_zone.php?{$query_string}");
    }
}
require 'subclasses/zone_html.php';
$html = new zone_html();
$html->draw_header('Delete Zone', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->draw_hidden('zone_id');
$html->detail_view = TRUE;
$html->draw_controls('delete');
$html->draw_footer();
コード例 #5
0
ファイル: edit_zone.php プロジェクト: seans888/Bgy-Project
//****************************************************************************************
//Generated by Cobalt, a rapid application development framework. http://cobalt.jvroig.com
//Cobalt developed by JV Roig (jvroig@jvroig.com)
//****************************************************************************************
require 'path.php';
init_cobalt('Edit zone');
if (isset($_GET['zone_id'])) {
    $zone_id = urldecode($_GET['zone_id']);
    require 'form_data_zone.php';
}
if (xsrf_guard()) {
    init_var($_POST['btn_cancel']);
    init_var($_POST['btn_submit']);
    require 'components/query_string_standard.php';
    require 'subclasses/zone.php';
    $dbh_zone = new zone();
    $object_name = 'dbh_zone';
    require 'components/create_form_data.php';
    extract($arr_form_data);
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button');
        redirect("listview_zone.php?{$query_string}");
    }
    if ($_POST['btn_submit']) {
        log_action('Pressed submit button');
        $message .= $dbh_zone->sanitize($arr_form_data)->lst_error;
        extract($arr_form_data);
        if ($dbh_zone->check_uniqueness_for_editing($arr_form_data)->is_unique) {
            //Good, no duplicate in database
        } else {
            $message = "Record already exists with the same primary identifiers!";
コード例 #6
0
ファイル: create.php プロジェクト: htom78/XZB2c
                                <td class="label"><label for="shipping">货运费用 <span class="required">*</span></label></td>
                                <td class="value">
                                <?php 
echo $form->dropDownList($model, 'carrier_shipping_handing', lookup::items('YesAndNo'), array('class' => 'required-entry required-entry input-select', 'id' => 'shipping', 'name' => 'carrier[carrier_shipping_handing]'));
?>
                                </td>
                                <td class="scope-label"><span class="nobr"></span></td>
                                <td><small>&nbsp;</small></td>
                            </tr>

                            <tr>
                                <td class="label"><label for="carrier_zone">区域挂接 <span class="required">*</span></label></td>
                                <td class="value">
                                    <select multiple="multiple" name="carrier_zone[]" id="product_satus" class="required-entry input-text multiselect">
                                    <?php 
foreach (zone::items() as $key => $row) {
    $sel = "";
    if (isset($zones) && !empty($zones)) {
        foreach ($zones as $item) {
            if ($key == $item) {
                $sel = "selected='true'";
                break;
            }
        }
    }
    echo "<option value='{$key}'{$sel}>{$row}</option>";
}
?>
                                    </select>
                                </td>
                                <td class="scope-label"><span class="nobr"></span></td>
コード例 #7
0
ファイル: create.php プロジェクト: htom78/XZB2c
echo $form->textField($model, 'ISO_code', array('class' => 'required-entry required-entry input-text', 'name' => 'country[ISO_code]', 'id' => 'ISO_code'));
?>
                                    </td>
                                    <td class="scope-label">
                                        <span class="nobr"><?php 
echo $form->error($model, 'ISO_code');
?>
</span>
                                    </td>
                                    <td><small></small></td>
                                </tr>
                                 <tr>
                                <td class="label"><label for="zone">区域 <span class="required">*</span></label></td>
                                <td class="value">
                                <?php 
echo $form->dropDownList($model, 'zone_ID', zone::items(), array('class' => 'required-entry required-entry input-select', 'id' => 'zone', 'name' => 'country[zone_ID]'));
?>
                                </td>
                                <td class="scope-label"><span class="nobr"></span></td>
                                <td><small>&nbsp;</small></td>
                            </tr>
                              <tr>
                                <td class="label"><label for="contain_states">是否包含州 <span class="required">*</span></label></td>
                                <td class="value">
                                <?php 
echo $form->dropDownList($model, 'contain_states', lookup::items('YesAndNo'), array('class' => 'required-entry required-entry input-select', 'id' => 'contain_states', 'name' => 'country[contain_states]'));
?>
                                </td>
                                <td class="scope-label"><span class="nobr"></span></td>
                                <td><small>&nbsp;</small></td>
                            </tr>
コード例 #8
0
ファイル: index.php プロジェクト: htom78/XZB2c
<div id="zoneGrid">
        <?php 
$this->widget('TradeGrid', array('dataProvider' => $model->search(), 'filter' => $model, 'htmlOptions' => array('class' => 'hor-scroll'), 'columns' => array(array('header' => '编号', 'name' => 'state_ID', 'type' => 'raw'), array('header' => '名称', 'name' => 'name', 'type' => 'raw'), array('header' => '区域', 'name' => 'zone_ID', 'type' => 'raw', 'value' => 'zone::item($data->zone_ID)', 'filter' => zone::items()), array('header' => '国家', 'name' => 'country_ID', 'type' => 'raw', 'value' => 'country::item($data->country_ID)', 'filter' => country::items(true)), array('header' => 'ISO code', 'name' => 'iso_code', 'type' => 'raw'), array('header' => '激活', 'name' => 'active', 'value' => 'lookup::item("YesAndNo",$data->active)', 'filter' => lookup::items('YesAndNo'), 'type' => 'raw'), array('class' => 'CButtonColumn', 'template' => '{update} {delete}'))));
?>
</div>
コード例 #9
0
ファイル: csv_zone.php プロジェクト: seans888/Bgy-Project
//Generated by Cobalt, a rapid application development framework. http://cobalt.jvroig.com
//Cobalt developed by JV Roig (jvroig@jvroig.com)
//****************************************************************************************
require 'path.php';
init_cobalt('View zone');
if (xsrf_guard()) {
    init_var($_POST['btn_cancel']);
    init_var($_POST['btn_submit']);
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button');
        redirect("listview_zone.php");
    }
    if ($_POST['btn_submit']) {
        log_action('Pressed submit button');
        require 'subclasses/zone.php';
        $dbh_zone = new zone();
        if ($message == "") {
            log_action('Exported table data to CSV');
            $timestamp = date('Y-m-d');
            $token = generate_token(0, 'fs');
            $csv_name = $token . $_SESSION['user'] . '_zone_' . $timestamp . '.csv';
            $filename = TMP_DIRECTORY . '/' . $csv_name;
            $csv_contents = $dbh_zone->export_to_csv();
            $csv_file = fopen($filename, "wb");
            fwrite($csv_file, $csv_contents);
            fclose($csv_file);
            chmod($filename, 0755);
            $csv_name = urlencode($csv_name);
            $message = 'CSV file successfully generated: <a href="/' . BASE_DIRECTORY . '/download_generic.php?filename=' . $csv_name . '">Download the CSV file.</a>';
            $message_type = 'system';
        }
コード例 #10
0
<?php

require 'components/get_listview_referrer.php';
require 'subclasses/zone.php';
$dbh_zone = new zone();
$dbh_zone->set_where("zone_id='" . quote_smart($zone_id) . "'");
if ($result = $dbh_zone->make_query()->result) {
    $data = $result->fetch_assoc();
    extract($data);
}