function toPage(page,action,hidname) { if(typeof action != "undefined") { document.mainform.action = action; } if(hidname && hidname != ""){ document.getElementById(hidname).value = page; } else{ document.mainform.p.value = page; } if( document.mainform.searchFlag ) document.mainform.searchFlag.value="page"; document.mainform.target="_self"; document.mainform.submit(); } function toSub(id,mode,page,action){ if(mode=="DELETE"){ if(!confirm("削除してもよろしいですか?")) return false; } if(typeof action != "undefined") { document.mainform.action = action; } document.mainform.id.value = id; document.mainform.mode.value = mode; if(document.mainform.p && page != undefined){ document.mainform.p.value = page; } document.mainform.submit(); } function toSort(sortby,mode) { if(document.getElementById("mode") && mode != undefined){ document.getElementById("mode").value = mode; } document.mainform.sortby.value=sortby; document.mainform.submit(); } function toShow(data) { var parentclass = new Array(); parentclass = document.getElementById('parentclass').value; document.write(data); } function buyerdetail(id) { var url='project.php?mode=BUYERDETAIL&id='+id; var dialog = art.dialog({ id: 'buyerdetail', title: "バイヤー担当者詳細画面" }); $.ajax({ type: 'POST', url: url, success: function (data) {dialog.content(data);}, cache: false }); } function filedownloadlogin(fileid) { var url='openproject.php?mode=FILEDOWNLOGIN'; var dialog = art.dialog({ id: 'filedownloadlogin', title: "添付ファイルダウンロード認証" }); $.ajax({ type: 'POST', url: url, data:{fileid:fileid}, success: function (data) {dialog.content(data);}, cache: false }); } function filedownloadloginAuth(fileid) { var url='openproject.php?mode=FILEDOWNLOGINAUTH'; var dialog = art.dialog({ id: 'filedownloadlogin', title: "添付ファイルダウンロード認証" }); if(document.getElementById("code")){ var code=document.getElementById('code').value; } if(document.getElementById("login_id")){ var login_id=document.getElementById('login_id').value; } if(document.getElementById("password")){ var password=document.getElementById('password').value; } $.ajax({ type: 'POST', url: url, data: {fileid:fileid,code:code,login_id:login_id,password:password}, success: function (data) { var st = data.split("|"); if (st[0]=="OK") { filedownclosedialog('filedownloadlogin'); window.location.href='getfile.php'+st[1]; } else { dialog.content(data); } }, cache: false }); } function closedialog(dialogid) { art.dialog({id:"buyerdetail"}).close(); } function filedownclosedialog(dialogid) { art.dialog({id:"filedownloadlogin"}).close(); } function grouptimer(display,nowtime,endtime,refresh_flg,num) { var _day = "日"; var _hour = "時間"; var _minute = "分"; var _second = "秒"; var _end = "終了しました"; var _end_interval = "終了判定中"; var hourZero = ""; var minuteZero = ""; var secondZero = ""; var Temp = ""; var now = new Date(); var sectime = parseInt((startTime - now.getTime()) / 1000) +(endtime - nowtime); var interval_sectime = parseInt((startTime - now.getTime()) / 1000) +(endtime - nowtime) + 10; if ((sectime <= 0) && (interval_sectime > 0)) { _end = _end_interval } //console.log(sectime + "/" + interval_sectime); if(sectime <= 0 ) { if(typeof(num)!="undefined"){ if(document.getElementById("chat")) { $("#chat").hide(); $("#new_chat").hide(); } for(var i=0;i 0) { Temp = dateLeft + _day + hourZero + hourLeft + _hour + minuteZero + minuteLeft + _minute + secondZero + secondLeft + _second; } else { if (hourLeft > 0) { Temp = hourLeft + _hour + minuteZero + minuteLeft + _minute + secondZero + secondLeft + _second; } else { if (minuteLeft > 0) { Temp = minuteLeft + _minute + secondZero + secondLeft + _second; } else { if (secondLeft > 0) { Temp = secondLeft + _second; } else { Temp = ''; } } } } if(Temp == ''){ if(typeof(num)!="undefined"){ if(document.getElementById("chat")) { $("#chat").hide(); $("#new_chat").hide(); } for(var i=0;i 0) { Temp = dateLeft + _day + hourZero + hourLeft + _hour + minuteZero + minuteLeft + _minute + secondZero + secondLeft + _second; } else { if (hourLeft > 0) { Temp = hourLeft + _hour + minuteZero + minuteLeft + _minute + secondZero + secondLeft + _second; } else { if (minuteLeft > 0) { Temp = minuteLeft + _minute + secondZero + secondLeft + _second; } else { if (secondLeft > 0) { Temp = secondLeft + _second; } else { Temp = ''; } } } } if(Temp == ''){ if (document.getElementById(display) != null ) { document.getElementById(display).innerHTML = _end; setresult(display); } continue; //return false; } else { if (document.getElementById(display) != null ) { document.getElementById(display).innerHTML = Temp; } } } if(typeof(refresh_flg) != "undefined" && typeof(timerID) != "undefined") { clearTimeout(timerID); } timerID = setTimeout("grouptimer2('"+display1+"',"+(nowtime)+","+endtime+")", 1000); } //入札確認の戻る function bid_confirm_back(raid,id,type) { document.mainform.raid.value = raid; document.mainform.id.value = id; document.mainform.type.value = type; document.mainform.mode.value ="BIDCONFIRMBACK"; document.mainform.submit(); } //入札確認 function bid_confirm(raid,id,type) { document.mainform.raid.value = raid; document.mainform.id.value = id; document.mainform.type.value = type; document.mainform.mode.value ="BIDCONFIRM"; document.mainform.submit(); } //入札 function bid(raid,id,type) { // if(!confirm("入札を行いますか?")) return false; document.mainform.raid.value = raid; document.mainform.id.value = id; document.mainform.type.value = type; document.mainform.mode.value ="BID"; document.mainform.submit(); } function getComma(num) { num = new String(num).replace(/,/g, ""); //(3)一旦カンマを削除 while(num != (num = num.replace(/^(-?\d+)(\d{3})/, "$1,$2"))); //(4)3桁毎にカンマを挿入 return num; } function setresult(display){ var idx=""; if(display.length>11){ idx=display.replace("displaydiv_",""); } if(document.getElementById("btn"+idx)) document.getElementById("btn"+idx).style.display=""; if(document.getElementById("tbtn"+idx)) document.getElementById("tbtn"+idx).style.display=""; if(document.getElementById("sbtn"+idx)) document.getElementById("sbtn"+idx).style.display="none"; if(document.getElementById("spanslp"+idx)) document.getElementById("spanslp"+idx).style.display="none"; } function showMoney(value,unit){ if(typeof(value)=="undefined"){return "";} if(typeof(unit)=="undefined"){unit="";} var round=Math.round(value); if(value==round) { return unit+numberFormat(Math.round(value),0); } else { return unit+numberFormat(value,2); } } function format_number(n){ alert(n); var b=parseInt(n).toString(); var len=b.length; if(len<=3){return b;} var r=len%3; return r>0?b.slice(0,r)+","+b.slice(r,len).match(/\d{3}/g).join(","):b.slice(r,len).match(/\d{3}/g).join(","); } function numberFormat(str,c){ str=str.toString(); str=ReplaceComma(str); if(str.length==0) return ''; var re,r; var s; re = /\./g; r = str.search(re); if(r){ s=str.split("."); str=s[0]; }else s[1]=""; str=parseInt(str); str=str.toString(); var ss = str.substr(0, 1); if(ss=='-'){ var flag='-'; str=str.substr(1); }else{ var flag=''; } var len = str.length ; var n= len%3 ; var returnstr=""; for(var i=0,loop=1;i0) { document.getElementById(id+'_price').value=accAdd(value,decrement); } } function toDown(id) { value=parseFloat(document.getElementById(id+'_price').value); decrement=parseFloat(document.getElementById(id+'_decrement').value); if((accSub(value,decrement))>0) { document.getElementById(id+'_price').value=accSub(value,decrement); } } function accAdd(arg1, arg2) { var r1, r2, m, c; try { r1 = arg1.toString().split(".")[1].length } catch (e) { r1 = 0 } try { r2 = arg2.toString().split(".")[1].length } catch (e) { r2 = 0 } c = Math.abs(r1 - r2); m = Math.pow(10, Math.max(r1, r2)) if (c > 0) { var cm = Math.pow(10, c); if (r1 > r2) { arg1 = Number(arg1.toString().replace(".", "")); arg2 = Number(arg2.toString().replace(".", "")) * cm; } else { arg1 = Number(arg1.toString().replace(".", "")) * cm; arg2 = Number(arg2.toString().replace(".", "")); } } else { arg1 = Number(arg1.toString().replace(".", "")); arg2 = Number(arg2.toString().replace(".", "")); } return (arg1 + arg2) / m } function accSub(arg1,arg2){ var r1,r2,m,n; try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0} try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0} m=Math.pow(10,Math.max(r1,r2)); n=(r1>=r2)?r1:r2; return ((arg1*m-arg2*m)/m).toFixed(n); } function noEnter(e) { var e = e || event; var keyNum = e.which || e.keyCode; return keyNum==13 ? false : true; } function addselect2(data) { var tmpArr=data.split('|o@o|'); var timestamp = (new Date()).valueOf(); $("#select_table").append('登録'); var obj=eval('(' + tmpArr[0] + ')'); document.getElementById("selectbig_"+timestamp).options.add(new Option("▼"+"第1分類を選択","")); for(var i=0;i<=obj.length-1;i++){ document.getElementById("selectbig_"+timestamp).options.add(new Option(obj[i].name,obj[i].id)); } var obj2=eval('(' + tmpArr[1] + ')'); document.getElementById("selectsmall_"+timestamp+"[]").options.add(new Option("▼"+"第2分類を選択","")); } function goRule(){ window.mainform.target='_blank'; document.mainform.mode.value = "RULE"; window.mainform.submit(); window.mainform.target='_self'; document.mainform.mode.value = ""; } function changesmall(id,select){ jQuery.post('admin.php',{mode:"SHOWSMALL",id:select.options[select.selectedIndex].value},function(data){showselect(data,id);}); } function showselect(data,id) { if(document.getElementById("selectsmall_"+id+"[]").options.length !=0){ document.getElementById("selectsmall_"+id+"[]").options.length=0; } var obj=eval('(' + data + ')'); document.getElementById("selectsmall_"+id+"[]").options.add(new Option("▼"+"第2分類を選択","")); for(var i=0;i<=obj.length-1;i++){ document.getElementById("selectsmall_"+id+"[]").options.add(new Option(obj[i].name,obj[i].id)); } } function addselect() { jQuery.post('admin.php',{mode:"GETSELECT"},function(data){addselect2(data);}); } function deleteselect(id) { var tb=document.getElementById('select_table'); var tr=document.getElementById('tr_'+id); tb.deleteRow(tr.rowIndex); } function checkOfficeAddress(obj) { if(obj.checked) { $("#office_address").val($("#address").val()); $("#office_city").val($("#city").val()); $("#office_postal_code").val($("#postal_code").val()); $("#office_address").val($("#address").val()); var sel=document.getElementsByName("pref")[0]; var sel2=document.getElementsByName("office_pref")[0]; sel2.value=sel.options[sel.options.selectedIndex].value; } } function changeBillAddressFlag(obj) { if(obj.value=="1") { $("#bill_address").val($("#address").val()); $("#bill_city").val($("#city").val()); $("#bill_postal_code").val($("#postal_code").val()); $("#bill_address").val($("#address").val()); var sel=document.getElementsByName("pref")[0]; var sel2=document.getElementsByName("bill_pref")[0]; sel2.value=sel.options[sel.options.selectedIndex].value; }else{ $("#bill_address").val($("#office_address").val()); $("#bill_city").val($("#office_city").val()); $("#bill_postal_code").val($("#office_postal_code").val()); $("#bill_address").val($("#office_address").val()); var sel=document.getElementsByName("office_pref")[0]; var sel2=document.getElementsByName("bill_pref")[0]; sel2.value=sel.options[sel.options.selectedIndex].value; } } function chat(id,p,error,comment) { var comment=arguments[3] || ""; var error= arguments[2] || ""; var url='project.php?mode=CHAT'; var dialog = art.dialog({ id: 'chat', title: "お知らせ一覧" }); $.ajax({ type: 'POST', url: url, data:{p:p,error:error,id:id,comment:comment}, success: function (data) {dialog.content(data);}, cache: false }); } function closea() { art.dialog({id:"chat"}).close(); } function addchat(id) { var url='project.php?mode=ADDCHAT'; var dialog = art.dialog({ id: 'chat', title: "お知らせ一覧" }); if(document.getElementById("comment")){ var comment=document.getElementById('comment').value; } if(document.getElementById("p")){ var p=document.getElementById('p').value; }else{ var p =1; } $.ajax({ type: 'POST', url: url, data:{id:id,comment:comment}, success: function (data) {chat(id,p,data,comment);}, cache: false }); }