function ZdcPrdSelect(){ this.type = 'ZdcPrdSelect'; this.result = false; this.text_data = null; } ZdcPrdSelect.prototype.getResult = function(){ return this.result; } ZdcPrdSelect.prototype.abort = function(){ if( this.httpReq ){ this.httpReq.abort(); } } ZdcPrdSelect.prototype.search = function(opts, callback){ var owner = this; var enc = "EUC"; var target_url = "http://127.0.0.1/cgi/prd_select.cgi"; var prm = ''; prm += '&key=53nQ2P9tlg4vBGnAjvBvnAqf9FmgbPB5idj5SdXuomA4fhEzTErxAzTjrxpzThngszFIlgrnFDng0z46oRAL0ungdzFblg3nFengVz57oRuLTE'; prm += '&cid='+opts.cid; prm += '&pid='+opts.pid; prm += '&opt=pigeon'; prm += '&enc='+enc; var request_url = target_url+'?'+prm; this.httpReq = new ZdcEmapHttpRequest('EUC', 'EUC'); this.httpReq.request(request_url, function(reference_text, status){ var result = new ZdcPrdSelectResult(reference_text, status); result.type = owner.type; result.options = opts; owner.result = result; //ZDC.trigger(owner, "end", result); if( callback != null ){ callback(result); } }, opts.timeout); } function ZdcPrdSelectOptions(frewd){ //default値 this.cid = ''; this.pid = ''; this.timeout = 60000; } function ZdcPrdSelectResult(text_data, status){ if( text_data == null ){ ZdcSetErrorStatus.call(this, '', status); return; } //header var res = new Array(); res = text_data.split('\n'); var header = res.shift(); var cols = header.split('\t'); var retcd = cols[0]; var cnt = parseFloat(cols[1]); var hitcnt = parseFloat(cols[2]); //Parameter Error Check // if( retcd.charAt(3) == '1' ){ // ZdcSetErrorStatus.call(this, retcd); // return; // } //record this.retCode = retcd; this.type = ''; this.status = status; this.recCount = cnt; this.hitCount = hitcnt; this.items = []; for(var i=0; i