示例#1
0
* @version $Id: admin.country_form.php 1958 2009-10-08 20:09:57Z soeren_nb $
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2007 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName(__FILE__);
require_once CLASSPATH . 'ps_zone.php';
$ps_zone = new ps_zone();
$country_id = vmGet($_REQUEST, 'country_id');
$option = empty($option) ? vmGet($_REQUEST, 'option', 'com_virtuemart') : $option;
if (!empty($country_id)) {
    $q = "SELECT * from #__{vm}_country WHERE country_id='{$country_id}'";
    $db->query($q);
    $db->next_record();
}
$funcname = !empty($country_id) ? "countryUpdate" : "countryAdd";
// Create the Form Control Object
$formObj = new formFactory($VM_LANG->_('PHPSHOP_COUNTRY_LIST_ADD'));
// Start the the Form
$formObj->startForm();
// Add necessary hidden fields
$formObj->hiddenField('country_id', $country_id);
?>
// Create the List Object with page navigation
$listObj = new listFactory($pageNav);
// print out the search field and a list heading
$listObj->writeSearchHeader($VM_LANG->_('PHPSHOP_COUNTRY_LIST_LBL'), VM_THEMEURL . 'images/administration/dashboard/countries.png', "admin", "country_list");
// start the list table
$listObj->startTable();
// these are the columns in the table
$columns = array("#" => "", "<input type=\"checkbox\" name=\"toggle\" value=\"\" onclick=\"checkAll(" . $num_rows . ")\" />" => "", $VM_LANG->_('PHPSHOP_COUNTRY_LIST_NAME') => "width=\"30%\"", $VM_LANG->_('PHPSHOP_ZONE_ASSIGN_CURRENT_LBL') => "width=\"25%\"", $VM_LANG->_('PHPSHOP_COUNTRY_LIST_3_CODE') => "width=\"20%\"", $VM_LANG->_('PHPSHOP_COUNTRY_LIST_2_CODE') => "width=\"20%\"", $VM_LANG->_('E_REMOVE') => "width=\"5%\"");
$listObj->writeTableHeader($columns);
$db->query($list);
$i = 0;
require_once CLASSPATH . 'ps_zone.php';
while ($db->next_record()) {
    $listObj->newRow();
    // The row number
    $listObj->addCell($pageNav->rowNumber($i));
    // The Checkbox
    $listObj->addCell(vmCommonHTML::idBox($i, $db->f("country_id"), false, "country_id"));
    $tmp_cell = "<a href=\"" . $sess->url($_SERVER['PHP_SELF'] . "?page=admin.country_form&limitstart={$limitstart}&keyword=" . urlencode($keyword) . "&country_id=" . $db->f("country_id")) . "\">";
    $tmp_cell .= $db->f("country_name") . "</a>&nbsp;&nbsp;";
    $tmp_cell .= "<a href=\"" . $sess->url($_SERVER['PHP_SELF'] . "?page=admin.country_state_list&country_id=" . $db->f("country_id")) . "\">[ " . $VM_LANG->_('PHPSHOP_STATE_LIST_MNU') . " ]</a>";
    $listObj->addCell($tmp_cell);
    $listObj->addCell(ps_zone::zone_name($db->f("zone_id")));
    $listObj->addCell($db->f("country_3_code"));
    $listObj->addCell($db->f("country_2_code"));
    $listObj->addCell($ps_html->deleteButton("country_id", $db->f("country_id"), "countryDelete", $keyword, $limitstart));
    $i++;
}
$listObj->writeTable();
$listObj->endTable();
$listObj->writeFooter($keyword);