Пример #1
0
} else {
    $js_key .= "\r\n\t\t\t\tdocument.adminForm.submit();";
}
$js_key .= "\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tfunction checkfornum(el)\r\n\t{\r\n\t\tvar i =0 ;\r\n\t\tfor (i=0;i<el.value.length;i++){\r\n\t\t   if (el.value.charCodeAt(i) > 47 && el.value.charCodeAt(i) < 58) { alert(\"" . JText::_('QTC_NUMERICS_NOT_ALLOWED') . "\"); el.value = el.value.substring(0,i); break;}\r\n\t\t}\r\n\t}\r\n\r\nfunction removeopt(elem,id){\r\n\tvar opt_id = techjoomla.jQuery('input[name=\"attri_opt[' + id + '][id]').val();\r\n\tif (opt_id){\r\n\tvar confirm = confirm('Do you want to remove this option?');\r\n\tif (confirm){\r\n\t\ttechjoomla.jQuery.ajax({\r\n\t\t\turl: '" . $qtc_base_url . "/index.php?option=com_quick2cart&controller=cartcheckout&task=delattributeoption&opt_id='+opt_id,\r\n\t\t\ttype: 'GET',\r\n\t\t\tsuccess: function(msg)\r\n\t\t\t{\r\n\t\t\t\twindow.location.reload();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\ntechjoomla.jQuery(elem).parent().remove();\r\n\r\n}\r\n\r\nfunction saveAttributeOptionCurrency(currdata,pid)\r\n\t{\r\n\t\tvar currvalue='';\r\n\t\ttechjoomla.jQuery('.currtext').each(function() {\r\n\t\t\tvar bval = techjoomla.jQuery(this).val();\r\n\t\t\tvar bid = techjoomla.jQuery(this).attr('id');\r\n\t\t\tcurrvalue+=bval+',';\r\n\r\n\t\t});\r\n\t}\r\nfunction qtc_ispositive(ele)\r\n{\r\n\t\tvar val=ele.value;\r\n\t\tif (val==0 || val < 0)\r\n\t\t{\r\n\t\t\tele.value='';\r\n\t\t\talert(\"" . JText::_('QTC_ENTER_POSITIVE_ORDER') . "\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\ttechjoomla.jQuery(document).ready(function(){\r\n\t\t/*to hide the new effect of chozen js */\r\n\t\tjQuery('.no_chzn').next('div .chzn-container').hide();\r\n\t\tjQuery('.no_chzn').show();\r\n\t});\r\n";
$document->addScriptDeclaration($js_key);
$addpre_select[] = JHtml::_('select.option', '+', JText::_('QTC_ADDATTRI_PREADD'));
$addpre_select[] = JHtml::_('select.option', '-', JText::_('QTC_ADDATTRI_PRESUB'));
//$addpre_select[] = JHtml::_('select.option','=', JText::_('QTC_ADDATTRI_PRESAM'));
$pid = $jinput->get('pid', 0, 'INTEGER');
$client = $jinput->get('client', '', 'STRING');
$attri_model = new quick2cartModelAttributes();
//print"<pre>";print_r($this->allAttribues);
// clearing previous contain(garbage)
$this->attribute_opt = array();
if (!empty($this->allAttribues[$i])) {
    $this->attribute_opt = $attri_model->getAttributeoption($this->allAttribues[$i]->itemattribute_id);
    $att_op_count = count($this->attribute_opt);
} else {
    $att_op_count = 0;
}
?>
<div class="row-fluid">
<div class="span12 ">
	<div class="row-fluid">

		<div class="span12">
			<div class="span4">
					<label class="" ><strong><?php 
echo JText::_('QTC_ADDATTRI_NAME');
?>
</strong></label>