예제 #1
0
 public function display($tpl = null)
 {
     $option = JRequest::getVar('option');
     $extra_field = new extra_field();
     $order_functions = new order_functions();
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_REDSHOP_QUOTATION_MANAGEMENT'));
     $document->addScript('components/' . $option . '/assets/js/json.js');
     $document->addScript('components/' . $option . '/assets/js/validation.js');
     $document->addScript('components/' . $option . '/assets/js/order.js');
     $document->addScript('components/' . $option . '/assets/js/common.js');
     $document->addScript('components/' . $option . '/assets/js/select_sort.js');
     $document->addStyleSheet('components/' . $option . '/assets/css/search.css');
     $document->addScript('components/' . $option . '/assets/js/search.js');
     $session = JFactory::getSession();
     $uri = JFactory::getURI();
     $lists = array();
     $model = $this->getModel();
     $detail = $this->get('Data');
     $Redconfiguration = new Redconfiguration();
     $user_id = JRequest::getVar('user_id', 0);
     if ($user_id != 0) {
         $billing = $order_functions->getBillingAddress($user_id);
     } else {
         $billing = $model->setBilling();
     }
     if (!is_object($detail)) {
         $detail = new stdClass();
     }
     $detail->user_id = $user_id;
     $session->set('offlineuser_id', $user_id);
     $userop = array();
     $userop[0] = new stdClass();
     $userop[0]->user_id = 0;
     $userop[0]->text = JText::_('COM_REDSHOP_SELECT');
     $userlists = $model->getUserData(0, "BT");
     $userlist = array_merge($userop, $userlists);
     $lists['userlist'] = JHTML::_('select.genericlist', $userlist, 'user_id', 'class="inputbox" onchange="showquotationUserDetail();" ', 'user_id', 'text');
     JToolBarHelper::title(JText::_('COM_REDSHOP_QUOTATION_MANAGEMENT') . ': <small><small>[ ' . JText::_('COM_REDSHOP_NEW') . ' ]</small></small>', 'redshop_order48');
     JToolBarHelper::save();
     JToolBarHelper::custom('send', 'send.png', 'send.png', JText::_('COM_REDSHOP_SEND'), false);
     JToolBarHelper::cancel();
     // PRODUCT/ATTRIBUTE STOCK ROOM QUANTITY CHECKING IS IMPLEMENTED
     $countryarray = $Redconfiguration->getCountryList((array) $billing);
     $billing->country_code = $countryarray['country_code'];
     $lists['country_code'] = $countryarray['country_dropdown'];
     $statearray = $Redconfiguration->getStateList((array) $billing);
     $lists['state_code'] = $statearray['state_dropdown'];
     $lists['quotation_extrafield'] = $extra_field->list_all_field(16, $billing->users_info_id);
     $this->lists = $lists;
     $this->detail = $detail;
     $this->billing = $billing;
     $this->userlist = $userlists;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
예제 #2
0
 public function display($tpl = null)
 {
     require_once JPATH_COMPONENT . '/helpers/extra_field.php';
     JToolBarHelper::title(JText::_('COM_REDSHOP_MANUFACTURER_MANAGEMENT_DETAIL'), 'redshop_manufact48');
     $uri = JFactory::getURI();
     $document = JFactory::getDocument();
     $option = JRequest::getVar('option');
     $document->addScript('components/' . $option . '/assets/js/validation.js');
     $this->setLayout('default');
     $lists = array();
     $detail = $this->get('data');
     $model = $this->getModel('manufacturer_detail');
     $template_data = $model->TemplateData();
     $isNew = $detail->manufacturer_id < 1;
     $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT');
     JToolBarHelper::title(JText::_('COM_REDSHOP_MANUFACTURER') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_manufact48');
     JToolBarHelper::apply();
     JToolBarHelper::save();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
     }
     $optiontemplet = array();
     $optiontemplet[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_Select'));
     $result = array_merge($optiontemplet, $template_data);
     $lists['template'] = JHTML::_('select.genericlist', $result, 'template_id', 'class="inputbox" size="1" ', 'value', 'text', $detail->template_id);
     $detail->excluding_category_list = explode(',', $detail->excluding_category_list);
     $product_category = new product_category();
     $lists['excluding_category_list'] = $product_category->list_all("excluding_category_list[]", 0, $detail->excluding_category_list, 10, false, true);
     $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $detail->published);
     $field = new extra_field();
     $list_field = $field->list_all_field(10, $detail->manufacturer_id);
     $lists['extra_field'] = $list_field;
     $this->lists = $lists;
     $this->detail = $detail;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
예제 #3
0
            $saple_data .= "<td style='padding-right:2px;'>";
            if ($catalog_colour[$c]->is_image == 1) {
                $saple_data .= "<img src='" . $catalog_colour[$c]->code_image . "' border='0'  width='27' height='27'/><br>";
            } else {
                $saple_data .= '<div style="background-color:' . $catalog_colour[$c]->code_image . ';width: 27px; height:27px; "></div> ';
            }
            $saple_check .= "<td><input type='checkbox' name='sample_code[]' id='sample_code" . $c . "' value='" . $catalog_colour[$c]->colour_id . "' ></td>";
            $saple_data .= "</td>";
        }
        $saple_check .= "</tr>";
        $saple_data .= "</tr>" . $saple_check . "<tr><td>&nbsp;</td></tr></table>";
    }
    $template_desc = str_replace("{product_samples}", $saple_data, $template_desc);
}
if (strstr($template_desc, "{address_fields}")) {
    $address_fields = $extra_field->list_all_field(9, 0, '', 1);
    $myfield = "<table class='admintable' border='0'>";
    $myfield .= $address_fields;
    $myfield .= '</table>';
    $template_desc = str_replace("{address_fields}", $myfield, $template_desc);
}
$template_desc = str_replace("{name_lbl}", JText::_('COM_REDSHOP_NAME_LBL'), $template_desc);
$template_desc = str_replace("{name}", '<input type="text" name="name_2" id="name" />', $template_desc);
$template_desc = str_replace("{email_lbl}", JText::_('COM_REDSHOP_EMAIL_LBL'), $template_desc);
$template_desc = str_replace("{email_address}", '<input type="text" name="email_address" id="email_address" />', $template_desc);
$template_desc = str_replace("{submit_button_sample}", '<input type="submit" name="samplesend" id="samplesend" onClick="return getCatalogSampleValidation();" value="' . JText::_('COM_REDSHOP_SAMPLE_SEND') . '" />', $template_desc);
echo $template_desc;
?>
	<input type="hidden" name="view" value="catalog" id="view"/>
	<input type="hidden" name="option" id="option" value="com_redshop"/>
	<input type="hidden" name="Itemid" value="<?php 
예제 #4
0
    public function changeshippingaddress($shippingadd_id, $user_id, $is_company)
    {
        $extra_field = new extra_field();
        $Redconfiguration = new Redconfiguration();
        $query = 'SELECT * FROM ' . $this->_table_prefix . 'users_info ' . 'WHERE address_type like "ST" ' . 'AND user_id = ' . (int) $user_id . ' ' . 'AND users_info_id = ' . (int) $shippingadd_id;
        $this->_db->setQuery($query);
        $list = $this->_db->loadObject();
        if (count($list) > 0) {
            $shipping = $list;
        } else {
            $shipping = $this->setShipping();
        }
        $allowCustomer = '';
        $allowCompany = '';
        if ($is_company) {
            $allowCustomer = 'style="display:none;"';
        } else {
            $allowCompany = 'style="display:none;"';
        }
        // Field_section 7 :Customer Address
        $lists['shipping_customer_field'] = $extra_field->list_all_field(14, $shipping->users_info_id);
        // Field_section 8 :Company Address
        $lists['shipping_company_field'] = $extra_field->list_all_field(15, $shipping->users_info_id);
        $countryarray = $Redconfiguration->getCountryList((array) $shipping, "country_code_ST", "ST");
        $shipping->country_code_ST = $shipping->country_code = $countryarray['country_code_ST'];
        $lists['country_code_ST'] = $countryarray['country_dropdown'];
        $statearray = $Redconfiguration->getStateList((array) $shipping, "state_code_ST", "country_code_ST", "ST", 1);
        $lists['state_code_ST'] = $statearray['state_dropdown'];
        $htmlshipping = '<table class="adminlist" border="0" width="100%">';
        $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('FIRSTNAME') . ':</td>';
        $htmlshipping .= '<td><input class="inputbox" type="text" name="firstname_ST" maxlength="250" value="' . $shipping->firstname . '" /></td></tr>';
        $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('LASTNAME') . ':</td>';
        $htmlshipping .= '<td><input class="inputbox" type="text" name="lastname_ST" maxlength="250" value="' . $shipping->lastname . '" /></td></tr>';
        $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('ADDRESS') . ':</td>';
        $htmlshipping .= '<td><input class="inputbox" type="text" name="address_ST" maxlength="250" value="' . $shipping->address . '" /></td></tr>';
        $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('ZIP') . ':</td>';
        $htmlshipping .= '<td><input class="inputbox" type="text" name="zipcode_ST" maxlength="250" value="' . $shipping->zipcode . '" /></td></tr>';
        $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('CITY') . ':</td>';
        $htmlshipping .= '<td><input class="inputbox" type="text" name="city_ST" maxlength="250" value="' . $shipping->city . '" /></td></tr>';
        $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('COUNTRY') . ':</td>';
        $htmlshipping .= '<td>' . $lists['country_code_ST'] . '</td></tr>';
        $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('STATE') . ':</td>';
        $htmlshipping .= '<td>' . $lists['state_code_ST'] . '</td></tr>';
        $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('PHONE') . ':</td>';
        $htmlshipping .= '<td><input class="inputbox" type="text" name="phone_ST" maxlength="250" value="' . $shipping->phone . '" /></td></tr>';
        $htmlshipping .= '<tr><td colspan="2"><div id="exCustomerFieldST" ' . $allowCustomer . '>' . $lists['shipping_customer_field'] . '</div>
							<div id="exCompanyFieldST" ' . $allowCompany . '>' . $lists['shipping_company_field'] . '</div></td></tr>';
        $htmlshipping .= '</table>';
        return $htmlshipping;
    }
예제 #5
0
    $template_edata = explode('{product_loop_end}', $template_sdata[1]);
    $template_end = $template_edata[1];
    $template_middle = $template_edata[0];
    $template_middle = $carthelper->replaceCartItem($template_middle, $cart, 0, DEFAULT_QUOTATION_MODE);
    $template_desc = $template_start . $template_middle . $template_end;
}
$template_desc = $carthelper->replaceLabel($template_desc);
if ($user->id) {
    $template_desc = $carthelper->replaceBillingAddress($template_desc, $detail);
    $template_desc .= '<input type="hidden" name="user_email" id="user_email" value="' . $detail->user_email . '"/>';
} else {
    $billing = '<table width="90%">
	<tr><td width="100" align="right">' . JText::_('COM_REDSHOP_EMAIL') . ':</td>
		<td><input type="text" name="user_email" id="user_email" value=""/></td></tr>';
    if (strstr($template_desc, "{quotation_custom_field_list}")) {
        $billing .= $extra_field->list_all_field(16, $detail->user_info_id, "", "tbl");
        $template_desc = str_replace("{quotation_custom_field_list}", "", $template_desc);
    } else {
        $template_desc = $extra_field->list_all_field(16, $detail->user_info_id, "", "", $template_desc);
    }
    $billing .= '</table>';
    $template_desc = str_replace("{billing_address_information_lbl}", JText::_('COM_REDSHOP_BILLING_ADDRESS_INFORMATION_LBL'), $template_desc);
    $template_desc = str_replace("{billing_address}", $billing, $template_desc);
}
$cancel_btn = '<input type="submit" class="greenbutton" name="cancel" value="' . JText::_("COM_REDSHOP_CANCEL") . '" onclick="javascript:document.adminForm.task.value=\'cancel\';"/>';
$quotation_btn = '<input type="submit" class="greenbutton" name="addquotation" value="' . JText::_("COM_REDSHOP_REQUEST_QUOTATION") . '" onclick="return validateInfo();"/>';
$quotation_btn .= '<input type="hidden" name="option" value="com_redshop" />';
$quotation_btn .= '<input type="hidden" name="Itemid" value="' . $Itemid . '" />';
$quotation_btn .= '<input type="hidden" name="task" value="addquotation" />';
$quotation_btn .= '<input type="hidden" name="view" value="quotation" />';
$quotation_btn .= '<input type="hidden" name="return" value="' . $return . '" />';
예제 #6
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $context = 'shipping_rate';
     $shippinghelper = new shipping();
     $userhelper = new rsUserhelper();
     $uri = JFactory::getURI();
     $model = $this->getModel();
     $db = JFactory::getDbo();
     $id = $app->getUserStateFromRequest($context . 'extension_id', 'extension_id', '0');
     $shipping = $shippinghelper->getShippingMethodById($id);
     $option = JRequest::getVar('option');
     $document = JFactory::getDocument();
     $document->addScript('components/' . $option . '/assets/js/select_sort.js');
     $document->addStyleSheet('components/' . $option . '/assets/css/search.css');
     $document->addScript('components/' . $option . '/assets/js/search.js');
     $document->addScript('components/' . $option . '/assets/js/common.js');
     $shippingpath = JPATH_ROOT . '/plugins/' . $shipping->folder . '/' . $shipping->element . '.xml';
     $myparams = new JRegistry($shipping->params, $shippingpath);
     $is_shipper = $myparams->get('is_shipper');
     $shipper_location = $myparams->get('shipper_location');
     $jtitle = $shipper_location ? JText::_('COM_REDSHOP_SHIPPING_LOCATION') : JText::_('COM_REDSHOP_SHIPPING_RATE');
     $this->setLayout('default');
     $lists = array();
     $detail = $this->get('data');
     $isNew = $detail->shipping_rate_id < 1;
     $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT');
     JToolBarHelper::title($jtitle . ': <small><small>[ ' . $shipping->name . ' : ' . $text . ' ]</small></small>', 'redshop_shipping_rates48');
     JToolBarHelper::save();
     JToolBarHelper::apply();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
     }
     $q = "SELECT  country_3_code as value,country_name as text from #__" . TABLE_PREFIX . "_country ORDER BY country_name ASC";
     $db->setQuery($q);
     $countries[] = JHTML::_('select.option', '0', '- ' . JText::_('COM_REDSHOP_SELECT_COUNTRY') . ' -', 'value', 'text');
     $countries = array_merge($countries, $db->loadObjectList());
     $shipping_rate_state = array();
     if ($detail->shipping_rate_country) {
         $shipping_rate_state = $model->GetStateList($detail->shipping_rate_country);
     }
     $detail->shipping_rate_state = explode(',', $detail->shipping_rate_state);
     $tmp = new stdClass();
     $tmp = @array_merge($tmp, $detail->shipping_rate_state);
     $lists['shipping_rate_state'] = JHTML::_('select.genericlist', $shipping_rate_state, 'shipping_rate_state[]', 'class="inputbox" multiple="multiple"', 'value', 'text', $detail->shipping_rate_state);
     $detail->shipping_rate_country = explode(',', $detail->shipping_rate_country);
     $tmp = new stdClass();
     $tmp = @array_merge($tmp, $detail->shipping_rate_country);
     $lists['shipping_rate_country'] = JHTML::_('select.genericlist', $countries, 'shipping_rate_country[]', 'class="inputbox" multiple="multiple" onchange="getStateList()" ', 'value', 'text', $detail->shipping_rate_country);
     $detail->shipping_rate_on_category = explode(',', $detail->shipping_rate_on_category);
     $product_category = new product_category();
     $lists['shipping_rate_on_category'] = $product_category->list_all("shipping_rate_on_category[]", 0, $detail->shipping_rate_on_category, 10, false, true);
     $shoppergroup = $userhelper->getShopperGroupList();
     $detail->shipping_rate_on_shopper_group = explode(',', $detail->shipping_rate_on_shopper_group);
     $lists['shipping_rate_on_shopper_group'] = JHTML::_('select.genericlist', $shoppergroup, 'shipping_rate_on_shopper_group[]', 'class="inputbox" multiple="multiple" ', 'value', 'text', $detail->shipping_rate_on_shopper_group);
     $lists['deliver_type'] = JHTML::_('select.booleanlist', 'deliver_type', 'class="inputbox"', $detail->deliver_type, 'COM_REDSHOP_HOME', 'COM_REDSHOP_POSTOFFICE');
     $productData = array();
     $result_container = array();
     if ($detail->shipping_rate_on_product) {
         $result_container = $model->GetProductListshippingrate($detail->shipping_rate_on_product);
     }
     $lists['product_all'] = JHTML::_('select.genericlist', $productData, 'product_all[]', 'class="inputbox" multiple="multiple" ', 'value', 'text', $detail->shipping_rate_on_product);
     $lists['shipping_product'] = JHTML::_('select.genericlist', $result_container, 'container_product[]', 'class="inputbox" onmousewheel="mousewheel(this);" ondblclick="selectnone(this);" multiple="multiple"  size="15" style="width:200px;" ', 'value', 'text', 0);
     $field = new extra_field();
     // Extra field
     $list_field = $field->list_all_field(11, $detail->shipping_rate_id);
     $lists['extra_field'] = $list_field;
     $shippingVatGroup = $model->getVatGroup();
     $temps = array((object) array('value' => '', 'text' => JText::_('COM_REDSHOP_SELECT')));
     $shippingVatGroup = array_merge($temps, $shippingVatGroup);
     $shippingfor = array((object) array('value' => 0, 'text' => JText::_('COM_REDSHOP_BOTH')), (object) array('value' => 1, 'text' => JText::_('COM_REDSHOP_COMPANY_ONLY')), (object) array('value' => 2, 'text' => JText::_('COM_REDSHOP_PRIVATE')));
     $lists['company_only'] = JHTML::_('select.genericlist', $shippingfor, 'company_only', 'class="inputbox" size="1" ', 'value', 'text', $detail->company_only);
     $lists['shipping_tax_group_id'] = JHTML::_('select.genericlist', $shippingVatGroup, 'shipping_tax_group_id', 'class="inputbox" size="1" ', 'value', 'text', $detail->shipping_tax_group_id);
     $this->is_shipper = $is_shipper;
     $this->shipper_location = $shipper_location;
     $this->lists = $lists;
     $this->detail = $detail;
     $this->shipping = $shipping;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
예제 #7
0
 public function display($tpl = null)
 {
     $option = JRequest::getVar('option');
     $extra_field = new extra_field();
     $order_functions = new order_functions();
     $Redconfiguration = new Redconfiguration();
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_REDSHOP_ORDER'));
     $document->addScript('components/' . $option . '/assets/js/select_sort.js');
     $document->addStyleSheet('components/' . $option . '/assets/css/search.css');
     $document->addScript('components/' . $option . '/assets/js/search.js');
     $document->addScript('components/' . $option . '/assets/js/json.js');
     $document->addScript('components/' . $option . '/assets/js/validation.js');
     $document->addScript('components/' . $option . '/assets/js/order.js');
     $document->addScript('components/' . $option . '/assets/js/common.js');
     $uri = JFactory::getURI();
     $lists = array();
     $billing = array();
     $shippinginfo = array();
     $model = $this->getModel();
     $detail = $this->get('data');
     $redhelper = new redhelper();
     $payment_lang_list = $redhelper->getPlugins("redshop_payment");
     $language = JFactory::getLanguage();
     $base_dir = JPATH_ADMINISTRATOR;
     $language_tag = $language->getTag();
     for ($l = 0; $l < count($payment_lang_list); $l++) {
         $extension = 'plg_redshop_payment_' . $payment_lang_list[$l]->element;
         $language->load($extension, $base_dir, $language_tag, true);
     }
     $err = JRequest::getVar('err', '');
     $shipping_rate_id = JRequest::getVar('shipping_rate_id');
     $user_id = JRequest::getVar('user_id', 0);
     if ($user_id != 0) {
         $billing = $order_functions->getBillingAddress($user_id);
         $shippinginfo = $order_functions->getShippingAddress($user_id);
     } else {
         $billing = $model->setBilling();
     }
     $shipping_country = 0;
     $shipping_state = 0;
     $key = 0;
     $shippingop = array();
     $shippingop[0] = new stdClass();
     $shippingop[0]->users_info_id = 0;
     $shippingop[0]->text = JText::_('COM_REDSHOP_SELECT');
     if (count($shippinginfo) > 0) {
         $shipping_users_info_id = JRequest::getVar('shipping_users_info_id', 0);
         if ($shipping_users_info_id != 0) {
             for ($o = 0; $o < count($shippinginfo); $o++) {
                 if ($shippinginfo[$o]->users_info_id == $shipping_users_info_id) {
                     $key = $o;
                     break;
                 }
             }
             $shipping_country = $shippinginfo[$key]->country_code;
             $shipping_state = $shippinginfo[$key]->state_code;
         }
         $shippingop = array_merge($shippingop, $shippinginfo);
         $billisship = $shippinginfo[$key]->billisship = $shipping_users_info_id ? 0 : 1;
     } else {
         $shippinginfo[0] = $model->setShipping();
         $shipping_users_info_id = $shippinginfo[0]->users_info_id = 0;
         $billisship = $shippinginfo[0]->billisship;
     }
     $shdisable = $billisship ? "disabled" : "";
     $detail->user_id = $user_id;
     $lists['shippinginfo_list'] = JHTML::_('select.genericlist', $shippingop, 'shipp_users_info_id', 'class="inputbox" ' . $shdisable . ' onchange="getShippinginfo(this.value, ' . $billing->is_company . ');" ', 'users_info_id', 'text', $shipping_users_info_id);
     $payment_detail = $this->get('payment');
     JToolBarHelper::title(JText::_('COM_REDSHOP_ORDER') . ': <small><small>[ ' . JText::_('COM_REDSHOP_NEW') . ' ]</small></small>', 'redshop_order48');
     if ($err == "" && array_key_exists("users_info_id", $billing) && $billing->users_info_id) {
         JToolBarHelper::custom('savepay', 'save.png', 'save_f2.png', 'Save + Pay', false);
         JToolBarHelper::custom('save_without_sendmail', 'save.png', 'save_f2.png', JText::_('COM_REDSHOP_SAVE_WITHOUT_SEND_ORDERMAIL_LBL'), false);
         JToolBarHelper::save();
     }
     JToolBarHelper::cancel();
     $countryarray = $Redconfiguration->getCountryList((array) $billing, "country_code", "BT");
     $billing->country_code = $countryarray['country_code'];
     $lists['country_code'] = $countryarray['country_dropdown'];
     $statearray = $Redconfiguration->getStateList((array) $billing, "state_code", "country_code", "BT", 1);
     $lists['state_code'] = $statearray['state_dropdown'];
     $shipping['country_code_ST'] = $shippinginfo[$key]->country_code;
     $countryarray = $Redconfiguration->getCountryList((array) $shipping, "country_code_ST", "ST");
     $shipping['country_code_ST'] = $shippinginfo[$key]->country_code = $countryarray['country_code_ST'];
     $lists['country_code_ST'] = $countryarray['country_dropdown'];
     $statearray = $Redconfiguration->getStateList((array) $shipping, "state_code_ST", "country_code_ST", "ST", 1);
     $lists['state_code_ST'] = $statearray['state_dropdown'];
     $lists['is_company'] = JHTML::_('select.booleanlist', 'is_company', 'class="inputbox" onchange="showOfflineCompanyOrCustomer(this.value);" ', $billing->is_company, JText::_('COM_REDSHOP_USER_COMPANY'), JText::_('COM_REDSHOP_USER_CUSTOMER'));
     $lists['customer_field'] = $extra_field->list_all_field(7, $billing->users_info_id);
     $lists['company_field'] = $extra_field->list_all_field(8, $billing->users_info_id);
     $lists['shipping_customer_field'] = $extra_field->list_all_field(14, $shippinginfo[0]->users_info_id);
     $lists['shipping_company_field'] = $extra_field->list_all_field(15, $shippinginfo[0]->users_info_id);
     $this->lists = $lists;
     $this->detail = $detail;
     $this->billing = $billing;
     $this->shipping = $shippinginfo[$key];
     $this->shipping_users_info_id = $shipping_users_info_id;
     $this->payment_detail = $payment_detail;
     $this->shipping_rate_id = $shipping_rate_id;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
예제 #8
0
 public function product_template($template_id, $product_id, $section)
 {
     $redTemplate = new Redtemplate();
     if ($section == 1 || $section == 12) {
         $template_desc = $redTemplate->getTemplate("product", $template_id);
     } else {
         $template_desc = $redTemplate->getTemplate("category", $template_id);
     }
     if (count($template_desc) == 0) {
         return;
     }
     $template = $template_desc[0]->template_desc;
     $str = array();
     $sec = explode(',', $section);
     for ($t = 0; $t < count($sec); $t++) {
         $inArr[] = "'" . $sec[$t] . "'";
     }
     $in = implode(',', $inArr);
     $q = "SELECT field_name,field_type,field_section from " . $this->_table_prefix . "fields where field_section in (" . $in . ") ";
     $this->_db->setQuery($q);
     $fields = $this->_db->loadObjectlist();
     for ($i = 0; $i < count($fields); $i++) {
         if (strstr($template, "{" . $fields[$i]->field_name . "}")) {
             if ($fields[$i]->field_section == 12) {
                 if ($fields[$i]->field_type == 15) {
                     $str[] = $fields[$i]->field_name;
                 }
             } else {
                 $str[] = $fields[$i]->field_name;
             }
         }
     }
     $list_field = array();
     if (count($str) > 0) {
         $dbname = "'" . implode("','", $str) . "'";
         $field = new extra_field();
         for ($t = 0; $t < count($sec); $t++) {
             $list_field[] = $field->list_all_field($sec[$t], $product_id, $dbname);
         }
     }
     if (count($list_field) > 0) {
         return $list_field;
     } else {
         return "";
     }
 }
예제 #9
0
:
						</label>
					</td>
					<td>
						<input class="inputbox" type="text" name="phone" size="32" maxlength="250"
						       value="<?php 
echo @$shipping->phone;
?>
"/>
					</td>
				</tr>
				<tr>
					<?php 
$field = new extra_field();
if ($shipping->is_company == 1) {
    echo $extrafields = $field->list_all_field(15, $shipping->users_info_id);
} else {
    echo $extrafields = $field->list_all_field(14, $shipping->users_info_id);
}
?>
				</tr>
				<tr>
					<td></td>
					<td>
						<input type="submit" name="submit" value="<?php 
echo JText::_('COM_REDSHOP_SAVE');
?>
"
						       onclick="return validateInfo();">
					</td>
				</tr>
예제 #10
0
 public function product_template($template_id, $product_id, $section)
 {
     require_once JPATH_COMPONENT . '/helpers/extra_field.php';
     $query = 'SELECT template_desc FROM ' . $this->_table_prefix . 'template  WHERE template_id =' . $template_id;
     if ($section == 1) {
         $query .= ' and template_section="product" ';
     } else {
         $query .= ' and template_section="category" ';
     }
     $this->_db->setQuery($query);
     $template_desc = $this->_db->loadObject();
     $template = $template_desc->template_desc;
     $tmp1 = explode("{", $template);
     $str = '';
     for ($h = 0; $h < count($tmp1); $h++) {
         $word = explode("}", $tmp1[$h]);
         if ($h != 0) {
             $str .= "'" . $word[0] . "'";
         }
         if ($h != 0 && $h != count($tmp1) - 1) {
             $str .= ",";
         }
     }
     $field = new extra_field();
     $list_field = $field->list_all_field($section, $product_id, $str);
     /// field_section 6 :Userinformations
     return $list_field;
 }
예제 #11
0
 public function display($tpl = null)
 {
     $Redconfiguration = new Redconfiguration();
     $userhelper = new rsUserhelper();
     $extra_field = new extra_field();
     $shipping = JRequest::getVar('shipping', '', 'request', 'string');
     $option = JRequest::getVar('option', '', 'request', 'string');
     $document = JFactory::getDocument();
     $document->addScript('components/' . $option . '/assets/js/json.js');
     $document->addScript('components/' . $option . '/assets/js/validation.js');
     $uri = JFactory::getURI();
     $this->setLayout('default');
     $lists = array();
     $detail = $this->get('data');
     $isNew = $detail->users_info_id < 1;
     $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT');
     if ($shipping) {
         JToolBarHelper::title(JText::_('COM_REDSHOP_USER_SHIPPING_DETAIL') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_user48');
     } else {
         JToolBarHelper::title(JText::_('COM_REDSHOP_USER_MANAGEMENT_DETAIL') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_user48');
     }
     JToolBarHelper::apply();
     JToolBarHelper::save();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         JToolBarHelper::customX('order', 'redshop_order32', '', JText::_('COM_REDSHOP_PLACE_ORDER'), false);
         JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
     }
     $pagination = $this->get('Pagination');
     $user_groups = $userhelper->getUserGroupList($detail->users_info_id);
     $detail->user_groups = $user_groups;
     $shopper_detail = $userhelper->getShopperGroupList();
     $temps = array();
     $temps[0] = new stdClass();
     $temps[0]->value = 0;
     $temps[0]->text = JText::_('COM_REDSHOP_SELECT');
     $shopper_detail = array_merge($temps, $shopper_detail);
     $lists['shopper_group'] = JHTML::_('select.genericlist', $shopper_detail, 'shopper_group_id', '', 'value', 'text', $detail->shopper_group_id);
     $lists['tax_exempt'] = JHTML::_('select.booleanlist', 'tax_exempt', 'class="inputbox"', $detail->tax_exempt);
     $lists['block'] = JHTML::_('select.booleanlist', 'block', 'class="inputbox"', $detail->block);
     $lists['tax_exempt_approved'] = JHTML::_('select.booleanlist', 'tax_exempt_approved', 'class="inputbox"', $detail->tax_exempt_approved);
     $lists['requesting_tax_exempt'] = JHTML::_('select.booleanlist', 'requesting_tax_exempt', 'class="inputbox"', $detail->requesting_tax_exempt);
     $lists['is_company'] = JHTML::_('select.booleanlist', 'is_company', 'class="inputbox" onchange="showOfflineCompanyOrCustomer(this.value);" ', $detail->is_company, JText::_('COM_REDSHOP_USER_COMPANY'), JText::_('COM_REDSHOP_USER_CUSTOMER'));
     $lists['sendEmail'] = JHTML::_('select.booleanlist', 'sendEmail', 'class="inputbox"', $detail->sendEmail);
     $lists['extra_field'] = $extra_field->list_all_field(6, $detail->users_info_id);
     $lists['customer_field'] = $extra_field->list_all_field(7, $detail->users_info_id);
     $lists['company_field'] = $extra_field->list_all_field(8, $detail->users_info_id);
     $lists['shipping_customer_field'] = $extra_field->list_all_field(14, $detail->users_info_id);
     $lists['shipping_company_field'] = $extra_field->list_all_field(15, $detail->users_info_id);
     $countryarray = $Redconfiguration->getCountryList((array) $detail);
     $detail->country_code = $countryarray['country_code'];
     $lists['country_code'] = $countryarray['country_dropdown'];
     $statearray = $Redconfiguration->getStateList((array) $detail);
     $lists['state_code'] = $statearray['state_dropdown'];
     $this->lists = $lists;
     $this->detail = $detail;
     $this->request_url = $uri->toString();
     $this->pagination = $pagination;
     parent::display($tpl);
 }
예제 #12
0
$in = implode(',', $inArr);
// ToDo: SQL in a view? Move and fix this.
$q = "SELECT field_name,field_type,field_section from #__redshop_fields where field_section in (" . $in . ") ";
$db->setQuery($q);
$fields = $db->loadObjectlist();
for ($i = 0; $i < count($fields); $i++) {
    if (strstr($template, "{" . $fields[$i]->field_name . "}")) {
        if ($fields[$i]->field_section == 12) {
            if ($fields[$i]->field_type == 15) {
                $str[] = $fields[$i]->field_name;
            }
        } else {
            $str[] = $fields[$i]->field_name;
        }
    }
}
$list_field = array();
if (count($str) > 0) {
    $dbname = "'" . implode("','", $str) . "'";
    $field = new extra_field();
    for ($t = 0; $t < count($sec); $t++) {
        $list_field[] = $field->list_all_field($sec[$t], $product_id, $dbname);
    }
}
if (is_array($list_field)) {
    for ($i = 0; $i < count($list_field); $i++) {
        echo $list_field[$i];
    }
} else {
    echo $list_field;
}