Server : Apache
System : Linux iZ2vcgyutqttsd1p850kl8Z 3.10.0-1160.92.1.el7.x86_64 #1 SMP Tue Jun 20 11:48:01 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 5.6.40
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Directory :  /www/wwwroot/saimikebio.com/mobile/js/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : /www/wwwroot/saimikebio.com/mobile/js/magiczoom_plus.js
function changeAtt(t,goods_id) {
	if(t.lastChild.checked != undefined){
		t.lastChild.checked='checked';
	}
	for (var i = 0; i<t.parentNode.childNodes.length;i++) {
		if (t.parentNode.childNodes[i].className == 'cattsel') {
			t.parentNode.childNodes[i].className = '';
		}
	}

	t.className = "cattsel";
	var formBuy = document.forms['ECS_FORMBUY'];
	spec_arr = getSelectedAttributes(formBuy);
	Ajax.call('goods.php?act=get_products_info', 'id=' + spec_arr+ '&goods_id=' + goods_id, shows_number, 'GET', 'JSON');
	//changePrice();    


}

function show_attr_status(theid, goods_id, attr_id_bee)
{

	var selected_first=new Array();
	selected_first[0] = theid.id.replace('xuan_a_','');
	var spec_attr_type = document.getElementsByName('spec_attr_type');

	var mylist = theid.parentNode.getElementsByTagName("a");
	for(zzz=0; zzz<mylist.length; zzz++)
	{
		if(mylist[zzz].className!='wuxiao')
		{
				mylist[zzz].onclick=function(){
					show_attr_status(this, goods_id, attr_id_bee);
				}
		}
		var my_input_id = mylist[zzz].id.replace('xuan_a_', 'spec_value_');
		document.getElementById(my_input_id).checked=false;
	}
	var the_input_id = theid.id.replace('xuan_a_', 'spec_value_');
	var the_img_id = theid.id.replace('xuan_a_', 'spec_img_');
	theid.onclick=function(){}
	document.getElementById(the_input_id).checked="checked";
	if(document.getElementById(the_img_id)){
		goods_img_src = $("#"+the_img_id)[0].src;
		$("#ECS_GOODS_ATTR_THUMB").attr("src",goods_img_src);
	}

	var bee= theid.parentNode.id.replace('catt_', '');
	 for (iii=0;iii<spec_attr_type.length;iii++ )
	 {
	     selid_bee=0;
	     if (spec_attr_type[iii].value != bee)
	     {
		var s1=document.getElementById('xuan_'+spec_attr_type[iii].value);
		var s1_list = s1.getElementsByTagName("a");
		for(jjj=0;jjj<s1_list.length;jjj++)
		{	
			s1_a_id = s1_list[jjj].id.replace('xuan_a_','');
			if (is_exist_prod(selected_first, s1_a_id, myString) )
			{					
				if (selid_bee)
				{
					if (s1_list[jjj].className == 'cattsel')
					{
						selid_bee = s1_a_id;
					}
				}
				else
				{
					selid_bee =  s1_a_id;
				}
				s1_list[jjj].className = '';
				s1_list[jjj].onclick=function(){
					show_attr_status(this, goods_id, attr_id_bee);
				}
			}
			else
			{
				s1_list[jjj].className = 'wuxiao';
				s1_list[jjj].onclick=function(){}				
			}
			document.getElementById('spec_value_' + s1_a_id).checked = false;
		}
		document.getElementById('spec_value_' + selid_bee).checked = "checked";
		selected_first.push(selid_bee);
		document.getElementById('xuan_a_'+selid_bee).className='cattsel';
		document.getElementById('xuan_a_'+selid_bee).onclick=function(){}		
	     }
	}
	changeAtt(theid, goods_id);	
	changePrice();
 }
 function is_exist_prod(selected_first, id, prod_exist_arr)
 {
	if (prod_exist_arr.length == 0)
	{
		return 0;
	}
	var bee_selected = selected_first.slice(0);
	bee_selected.push(id);	
	var all_valid =0;
	for (var i in prod_exist_arr)
	{
		var first_exist=1;
		for (var j in bee_selected)
		{
			if ( prod_exist_arr[i].indexOf("|" + bee_selected[j] + "|") =='-1')
			{
				first_exist=0;
				break;
			}
		}
		if(first_exist==1)
		{
			all_valid=1;
			break;
		}
	
	}
	return all_valid;
 }