2014年3月31日 星期一

mysql-log



View turn on or not 

SELECT * from information_schema.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'LOG_BIN';
SHOW VARIABLES LIKE 'log_bin'; 
SHOW  BINARY LOGS; 

Turn on the Log

vi /etc/mysql/my.cnf   or /etc/my.cnf  or /usr/etc/my.cnf  or ~/.my.cnf


log-bin=mysql-bin

The log inside /var/log/mysql/error.log

mysql-status

$ mysqld --help --verbose

asp-json

http://www.aspjson.com/

?([['1032298','11743566'],['1033260','101-3774906'],['1033261','850 203 605 SOH'],['1033262','101-3774907'],['1033263','850 203 616 SOH']])


'?([
'['1396235501819','Government Logistics Department','REF','A'],
'['1396235623593','Government Logistics Department','2','D'],
'['1396235673056','Government Logistics Department','ASDFAASDFAFD','D']
']);



$.getJSON(s,
function(data) {
if (data[0]){
lastOffset=offset;
}
}
)






http://stackoverflow.com/questions/5943630/basic-example-of-using-ajax-with-jsonp


2014年3月27日 星期四

business - letter

inf:  http://speakspeak.com/resources/general-english-vocabulary/business-letter-writing-phrases

http://www.gingersoftware.com/grammarcheck#.U2YNhfmSzTD




Yours faithfully or Yours sincerely; Dear Sir or Dear Mr



On this page we look at important phrases for writing letters and emails, such as when to use Yours faithfully and Yours sincerelyDear SirDear Madam, and so forth.
You know how important it is to speak good English in an international working environment. If you work for a company which does business abroad, you probably read and write a lot of English, too. Writing, like speaking, is communication. When writing letters and emails we need the skills to be able to express ourselves well and with the correct level of formality.
Do you have that skill? Ask yourself these questions:
  • Do you present yourself in a professional manner when you write?
  • What image do you give to the people who read your letters and emails?
In short, you want to give a professional image when you write to your customers and business partners. To get you started, we’ve prepared some lists of standard phrases:

10 good opening lines

We need an opening line in a business letter or professional email:
to make reference to previous correspondence; to say how we found the recipient’s name/address; to say why we are writing to the recipient.
  • With reference to your letter of 8 June, I … .
  • I am writing to enquire about … .
  • After having seen your advertisement in … , I would like … .
  • After having received your address from … , I … .
  • I received your address from … and would like … .
  • We/I recently wrote to you about … .
  • Thank you for your letter of 8 May.
  • Thank you for your letter regarding … .
  • Thank you for your letter/e-mail about … .
  • In reply to your letter of 8 May, … .

10 good closing lines

We need a closing line in a business letter or email:
to make a reference to a future event; to repeat an apology; to offer help
  • If you require any further information, feel free to contact me.
  • I look forward to your reply.
  • I look forward to hearing from you.
  • I look forward to seeing you.
  • Please advise as necessary.
  • We look forward to a successful working relationship in the future.
  • Should you need any further information, please do not hesitate to contact me.
  • Once again, I apologise for any inconvenience.
  • We hope that we may continue to rely on your valued custom.
  • I would appreciate your immediate attention to this matter.

asp-excel-numeric to string format

for each field_ in afields if r0=17 then f.write("<style> TD { mso-number-format:\@; } </style>") end if f.write("<td>") f.write(field_) f.write("</td>") if r0=17 then f.write("<style> TD { mso-number-format:General; } </style>") end if r0=r0+1 next

f.write(field_)
'f.write(":"&r0)
f.write("</td>")
r0=r0+1
next

2014年3月26日 星期三

generator-style generator-valign generator-config


.
table style
0.61,PRODUCT_VIEW0.DESCRIPTION,text:GRID,27%,150,Description,,{inLineStyle}padding-left:2px;padding-right:2px;background:white;{/inLineStyle}


{labelInLineStyle}display:none;{/labelInLineStyle}
{labelInLineStyle}text-align:right;{/labelInLineStyle}
{labelInLineStyle}vertical-align:top;{/labelInLineStyle}

formHeaderTableProperties=cellspacing:'5'


productListOnly
FontSize=12px
LabelFontSize=13px
colWidth1=20
colWidth2=20
colWidth3=20
colWidth4=20
colWidth5=0
colWidth6=0
GridStyle=width:85%; margin:auto;,width:85%; margin:auto;
InputTextHeight=20px
GridRowHighLight=RGB(255,255,187) 
LabelFontSize=12px
EachLineHeight=4px
InputTextRadius=1px


GridHeight=140px
LABEL_WIDTH=100px   <= important
FontSize=12px
PageFrameHeight=300px
formHeaderTableLayout=fixed
PageBackGroundColor=#e1e1e1
FormWidth=90%
BodyTopMargin=45px
LineSpacing=3px.
LabelFontSize=12px
EachLineHeight=4px
InputTextRadius=1px
InputTextHeight=18px
Page3ColWidth=2,20,2,2      <= each page label and input format (have 10 page)


FocusBackGroundColor=#abcdef
GridRowHighLight=RGB(255,255,187)
GridStyle=width:85%; margin:auto;,width:85%; margin:auto;
ReadonlyCssStyle=color:black; background:#dddddd;

colWidth1=2
colWidth2=25
colWidth3=2
colWidth4=20
colWidth5=5
colWidth6=0
modalWidth=700  // the inside modal display box size  (default is full size)
modalHeight=500  // the inside modal display box size  (default is full size)




{subformHeight}{/subformHeight}
{subformWidth}{/subformWidth}





generator-data hidden / refresh

Combo Box Data
content.txt
0.41,SALES_HEADER.CUSTOMER,combo,15,15,Customer,,{colSpan}3{/colSpan}{getJson} tableRead?table=CUSTOMER&fields=RECORDID,NAME&where=where status:`A` &format=S,S&callback=?{/getJson}  {refresh}currentEntity=_lookup('this.id');{/refresh}

Display ShortForm Data
0.61,MANUFACTURER.STATUS,text:GRID,18%,150,Status,,{data}D,draft,A,approved,F,Frozen{/data}



Display the Form Read the Special Record

input.jsp?mode=SINPUT&input=products.txt&config=productsConfig.txt&key=recordid&keyValue=1390296450593

Display the Form Grid List
config.txt
where=where status:`D`  or status:`A`  or status:`F` 

Get data from another form
config.txt
appendData0=input.jsp?input:dNotesPurchaseList.txt&config:dNotesPurchaseListConfig.txt&mode:CHOICE
appendData0Caption=Createor 
appendData0Source=POQTYOS
appendData0TargetKey=DNOTE_LINE.PO_RECORDID
appendData0HeaderSource=SALES_ORDER,COMPANY,DIVISION,SALES_CODE,SUPPLIER,SHIP_TO_CONTACT,COMPANY_NAME,SHIP_TO_ADDRESS,OUR_REF_NO,CONTRACT_NO
appendData0HeaderSourceFormat=S,S,S,S,S,S,S,S,S,S
appendData0HeaderTarget=DNOTE_HEADER.SALES_ORDER,DNOTE_HEADER.COMPANY,DNOTE_HEADER.DIVISION, DNOTE_HEADER.SALES_CODE,DNOTE_HEADER.SUPPLIER,DNOTE_HEADER.SHIP_TO_CONTACT,DNOTE_HEADER.COMPANY_NAME,DNOTE_HEADER.SHIP_TO_ADDRESS,DNOTE_HEADER.OUR_REF_NO,DNOTE_HEADER.YOUR_REF_NO


Hidden Data
config.txt
InvisibleRetrivalNumber=1

Refresh Data
config.txt
Refresh=s:_lookup("PRODUCT_GROUP.STATUS");s:$.trim(s);if(s!:'A'){$("#submit3").css( "display", "none" );} else {$("#submit3").css( "display", "inline" );}
Display Grid List (Dyanamice input) 
config.txt
formConstrain=and (status:`D` or status:`A`  or status:`F`) 
queryMode=or
Content.txt
#
0.34,query.productsName,text,100%:200px:400px,40,KeyWord ,,{setConstrain}_c0=_lookup('query.productsName');{/setConstrain}{colspan}2{/colspan} {labelInLineStyle}word-wrap:normal;{/labelInLineStyle}
#
0.21,query.market,check,0,0,: Market,,{default}1{/default} {setConstrain}_c1=document.getElementById("query.market").checked;if(_c1){_c01='market like `^'+_c0+'^`';} else {_c01='false';} {/setConstrain} 
0.21,query.category,check,0,0, : Category,,{default}1{/default} {setConstrain}_c2=document.getElementById("query.category").checked;if(_c2){_c02='category like `^'+_c0+'^`';} else {_c02='false';} {/setConstrain} 
0.21,query.sub_cateory,check,0,0, : Sub-Category,,{default}1{/default} {setConstrain}_c3=document.getElementById("query.sub_cateory").checked;if(_c3){_c03='sub_category like `^'+_c0+'^`';} else {_c03='false';} {/setConstrain} 
0.24,query.manufacturer,check,0,0, : Manufacturer,,{default}1{/default} {setConstrain}_c4=document.getElementById("query.manufacturer").checked;if(_c4){_c04='manufacturer like `^'+_c0+'^`';} else {_c04='false';} {/setConstrain} 
0.24,query.model,check,0,0, : Model,,{default}1{/default} {setConstrain}_c5=document.getElementById("query.model").checked;if(_c5){_c05='model like `^'+_c0+'^`';} else {_c05='false';} {/setConstrain} 

0.24,query.description,check,0,0, : Description,,{default}1{/default} {setConstrain}_c6=document.getElementById("query.description").checked;if(_c6){_c06='description like `^'+_c0+'^`';} else {_c06='false';} {/setConstrain} 


Market 
Category Sub-Category 
Manufacturer 
Model Description 

generator-form-button

config.txt

save Button
SaveButton1Caption=null <================== no save button 
SaveButton2Caption=Save and Approve
status Button
SaveButton2CaptionColor=red
SaveButton2ClickMethod=_refreshv2('PRODUCT.status','A');

SaveButton3Caption=Save and revoke
SaveButton3ClickMethod=_refreshv2('PRODUCT_GROUP.STATUS','D');

Refresh=s:_lookup("PRODUCT_GROUP.STATUS");s:$.trim(s);if(s!:'A'){$(".SaveButton3Caption").css( "display", "none" );} else {$(".SaveButton3Caption").css( "display", "inline" );}


print Button
printCaption0=PDF
printCaption0ClickMethod=PDFCreateAndView? db:'+DATABASE+'&create:dn&companyid:'+COMPANYID+'&file:'+DOCUMENT+'&recordid:'+RECORDID+'

getData Button (grid)
appendData0=input.jsp?input:dNotesPurchaseList.txt&config:dNotesPurchaseListConfig.txt&mode:CHOICE
appendData0Caption=Createor 
appendData0Source=POQTYOS
appendData0TargetKey=DNOTE_LINE.PO_RECORDID
appendData0HeaderSource=SALES_ORDER,COMPANY,DIVISION,SALES_CODE,SUPPLIER,SHIP_TO_CONTACT,COMPANY_NAME,SHIP_TO_ADDRESS,OUR_REF_NO,CONTRACT_NO
appendData0HeaderSourceFormat=S,S,S,S,S,S,S,S,S,S
appendData0HeaderTarget=DNOTE_HEADER.SALES_ORDER,DNOTE_HEADER.COMPANY,DNOTE_HEADER.DIVISION, DNOTE_HEADER.SALES_CODE,DNOTE_HEADER.SUPPLIER,DNOTE_HEADER.SHIP_TO_CONTACT,DNOTE_HEADER.COMPANY_NAME,DNOTE_HEADER.SHIP_TO_ADDRESS,DNOTE_HEADER.OUR_REF_NO,DNOTE_HEADER.YOUR_REF_NO



asp-excel javascript-excel

1. individual Name
2. fileName P_fileName
3. p_mode
4. Test the list
5 Edit the Button
6. Edit the call Program.

Example : salesBydotCom

Step 1
p_mode=trim(Request.querystring("p_mode")) 'for excel
p_fileName=trim(Request.querystring("p_fileName")) 'for excel

Step 2
fileName=Int((max-min+1)*Rnd+min)
if p_fileName<>"" then  'for excel
fileName=p_fileName 'for excel
end if 'for excel

Step 3
'for Excel
if p_mode="E" then
ReportName=ReportName+"_"+pcus+"_"
end if

Step 5
for each x in acustomerNOs
html=x
o=x
x=Replace(x, ",", "_")
x=Replace(x, " ", "_")
x=Replace(x, "'", "_")
o=Replace(o, "'", "_")
o=Replace(o, " ", "__")
response.write("<button class='customerButton' style='display:none; float:left;' onclick=custDisplay3('"&x&"','"&o&"');>"&html&"</button>")
next

Step 6
// for excel
function custDisplay3(pcustcode,sql_custcode){
$('.allcustcode').css('display','none');
$('.class_'+pcustcode).css('display','block');
sql_custcode=sql_custcode.replace(/__/g," ");
i=sql_custcode.indexOf("_");
if (i>1) sql_custcode=sql_custcode.substring(0,i);
url_='salesByDotComsList10.asp?cus='+sql_custcode+'&p_fileName=<%=fileName%>&p_mode=E&callback=?';
$.getJSON(url_,
function(data) {
if (data[0]){
for (r=0 ; r<data.length; r++)
{
//alert(data[0][0]);
//obj_field.options[r+1] = new Option(data[r][0],data[r][1]);
}
}
}
)
}



function callExcel Program(pcustcode){
$('.allcustcode').css('display','none');
$('.class_'+pcustcode).css('display','block');
sql_custcode=pcustcode
sql_custcode=sql_custcode.replace(/__/g," ");
i=sql_custcode.indexOf("_");
if (i>1) sql_custcode=sql_custcode.substring(0,i);
url_='forecastVSActualCustomerFtyList9.asp?cus='+sql_custcode+'&p_fileName=<%=fileName%>&p_mode=E&callback=?';
$.getJSON(url_,
function(data) {
}

}

generator-version

SaveButton3Caption=Save and Revoke
SaveButton3ClickMethod=_refreshv2('PAYMENT_HEADER.STATUS','D'); 
var mversion:_lookup('PAYMENT_HEADER.VERSION');_refreshv2('PAYMENT_HEADER.VERSION',++mversion);

2014年3月25日 星期二

asp-excel




/////////////////////////////////////////////////////  call and back /call.and.back////////////////////
<%
if  p_mode="E" then
response.write("parent.closeWindow();")
end if
%>
function newWindow(url) {
 popupWindow = window.open(
  url,
  'popUpWindow','height=500,width=650,left=10,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}

function closeWindow()
{
   if(false == popupWindow.closed)
   {
      popupWindow.close ();
   }
   else
   {
      alert('That window is already closed. Open the window first and try again!');
   }
}

//////////////////////////////////////////////// end of call and back //////////////////////////////////////////






function custDisplay3(pcustcode,sql_custcode){
$('.allcustcode').css('display','none');
$('.class_'+pcustcode).css('display','block');
sql_custcode=sql_custcode.replace(/__/g," ");

i=sql_custcode.indexOf("_");
if (i>1) sql_custcode=sql_custcode.substring(0,i);
<%
IF mode="C" THEN
response.write("url_='salesByMajorAndOtherList15.asp?prog='+sql_custcode+'&p_fileName="&fileName&"&p_mode=E';")
else
response.write("url_='salesByMajorAndOtherList15.asp?buyg='+sql_custcode+'&p_fileName="&fileName&"&p_mode=E';")
end if

%>

//url_='salesByMajorAndOtherList15.asp?buyg='+sql_custcode+'&p_fileName=<%=fileName%>&p_mode=E';

newWindow(url_);
}

generator-pdf


generator-print

printCaption0=PDF
printCaption0ClickMethod=PDFCreateAndView?db:erp&create:dn&file:dn1234&recordid:'+RECORDID+'


generator-approve-print
generator approve and print

SaveButton2Caption=Approve
SaveButton2CaptionColor=red
SaveButton2ClickMethod=_refreshv2('PURCHASE_HEADER.STATUS','A');window.open('PDFCreateAndView?db:'+DATABASE+'&create:po&companyid:'+COMPANYID+'&file:'+DOCUMENT+'&recordid:'+RECORDID+'','_blank','toolbar:0,scrollbars:0,location:0,location:no,width:1000,height:600');

generator-print-document (number)

0.12,DNOTE_HEADER.DNOTE_NO,text,10,10,D.Note No.,, {readonly} {refresh}DOCUMENT=($.trim(_lookup('this.id'))+'-'+$.trim(_lookup('DNOTE_HEADER.VERSION'))).replace('-0',''); if (DOCUMENT==''){$("#printCaption0").css("disabled", "disabled" );}{/refresh}

2014年3月24日 星期一

generator-example-getdata from other table

1. main form
2. call form

Purchase.txt (main form)
0.51,PURCHASE_HEADER.SUPPLIER,combo,18,18,Supplier,,{colSpan}3{/colSpan}{getJson} tableRead?table=VENDOR&fields=RECORDID,NAME&where=where status:`A` &format=S,S&callback=?{/getJson} {onChange}s10=this.value;s= 'tableRead?table=VENDOR&fields=ADDRESS&key=RECORDID&value='+s10+'&format=S&callback=?&db='+DATABASE ; $.getJSON(s,function(data) {if (data[0]){   s= data[0][0];      s=s.replace(new RegExp('<z><z>','g'), '\r');   _refreshv('PURCHASE_HEADER.CONTACT_ADDRESS',s);}});{/onChange} {refresh}currentEntity=_lookup('this.id');{/refresh}


PurchsaeConfig.txt  (main form)

appendData0=input.jsp?input:purchaseSalesOrderList.txt&config:purchaseSalesOrderListConfig.txt&mode:CHOICE  <remark>Call form</remark>
appendData0Caption=Creator
appendData0Source=SOQTYOS              <remark>After get the key from call from</remark>
appendData0TargetKey=PO.SODP_RecordID
appendData0HeaderSource=SALES_ORDER,COMPANY,DIVISION,SALES_CODE,SUPPLIER,SUPADD, SUPTEL,SUPCON,SOADD,CUSNAM,SOCON,SOTEL,PAYT,SALES_ORDER,SUPPLIER_REF
appendData0HeaderSourceFormat=S,S,S,S,S,S,S,S,S,S,S,S,S,S,S
appendData0HeaderTarget=PURCHASE_HEADER.SALES_ORDER,PURCHASE_HEADER.COMPANY,PURCHASE_HEADER.DIVISION, PURCHASE_HEADER.SALES_CODE,PURCHASE_HEADER.SUPPLIER,PURCHASE_HEADER.CONTACT_ADDRESS, PURCHASE_HEADER.CONTACT_NAME, PURCHASE_HEADER.CONTACT_TEL ,PURCHASE_HEADER.SHIP_TO_ADDRESS, PURCHASE_HEADER.COMPANY_NAME, PURCHASE_HEADER.SHIP_TO_CONTACT, PURCHASE_HEADER.SHIP_TO_TEL,PURCHASE_HEADER.PAYMENT_TERMS,PURCHASE_HEADER.OUR_REF_NO,PURCHASE_HEADER.YOUR_REF_NO
appendData0ActionAfter=currentEntity:_lookup('PURCHASE_HEADER.SUPPLIER');

purchaseSalesOrderListConfig.txt (call form) Source data

key=sosta
keyValue='A'
where=where SOqty>poqty  and SUPPLIER like `^'+parent.currentEntity+'^` and FIND_IN_SET(TRIM(SODP_RecordID),"'+parent.currentChoose+'"):0

mssql-date

http://msdn.microsoft.com/en-us/library/ms187928.aspx

select CONVERT(VARCHAR(10),a.[Requested Receipt Date],111);


Without century (yy) (1)
With century (yyyy)
Standard
Input/Output (3)
-
0 or100 (1,2)
Default
mon dd yyyy hh:miAM (or PM)
1
101
U.S.
1 = mm/dd/yy
101 = mm/dd/yyyy
2
102
ANSI
2 = yy.mm.dd
102 = yyyy.mm.dd
3
103
British/French
3 = dd/mm/yy
103 = dd/mm/yyyy
4
104
German
4 = dd.mm.yy
104 = dd.mm.yyyy
5
105
Italian
5 = dd-mm-yy
105 = dd-mm-yyyy
6
106 (1)
-
6 = dd mon yy
106 = dd mon yyyy
7
107 (1)
-
7 = Mon dd, yy
107 = Mon dd, yyyy
8
108
-
hh:mi:ss
-
9 or109 (1,2)
Default + milliseconds
mon dd yyyy hh:mi:ss:mmmAM (or PM)
10
110
USA
10 = mm-dd-yy
110 = mm-dd-yyyy
11
111
JAPAN
11 = yy/mm/dd
111 = yyyy/mm/dd
12
112
ISO
12 = yymmdd
112 = yyyymmdd
-
13 or113 (1,2)
Europe default + milliseconds
dd mon yyyy hh:mi:ss:mmm(24h)
14
114
-
hh:mi:ss:mmm(24h)
-
20 or120 (2)
ODBC canonical
yyyy-mm-dd hh:mi:ss(24h)
-
21 or121 (2)
ODBC canonical (with milliseconds)
yyyy-mm-dd hh:mi:ss.mmm(24h)
-
126 (4)
ISO8601
yyyy-mm-ddThh:mi:ss.mmm (no spaces)
Note Note
When the value for milliseconds (mmm) is 0, the millisecond value is not displayed. For example, the value '2012-11-07T18:26:20.000 is displayed as '2012-11-07T18:26:20'.
-
127(6, 7)
ISO8601 with time zone Z.
yyyy-mm-ddThh:mi:ss.mmmZ (no spaces)
Note Note
When the value for milliseconds (mmm) is 0, the milliseconds value is not displayed. For example, the value '2012-11-07T18:26:20.000 is displayed as '2012-11-07T18:26:20'.
-
130 (1,2)
Hijri (5)
dd mon yyyy hh:mi:ss:mmmAM
In this style, mon represents a multi-token Hijri unicode representation of the full month's name. This value will not render correctly on a default US installation of SSMS.
-
131 (2)
Hijri (5)
dd/mm/yyyy hh:mi:ss:mmmAM

2014年3月23日 星期日

tableRead-notes


tableRead-like

http://192.168.10.8:8080/erp/tableRead?
db=BR201312111529
&table=SOPOQTY
&order=recordID%20asc%20
&limit=25&offset=0&fields=recordid,if(isnull(SALES_ORDER),%22%22,SALES_ORDER),if(isnull(ITEM),%22%22,ITEM),if(isnull(DESCRIPTION),%22%22,DESCRIPTION),if(isnull(NAME),%22%22,NAME),if(isnull(SOQTY-POQTY),%22%22,SOQTY-POQTY)&key=sosta&value=%27A%27%20and%20SUPPLIER:`%`%20
&format=S,S,S,S,S,S
&where=where%20SOqty%3Epoqty%20and%20SUPPLIER%20like%20`^^`
&callback=?


example : where  (like, inlist , >  )
where=where SOqty>poqty  and SUPPLIER like `^'+parent.currentEntity+'^` and 
FIND_IN_SET(TRIM(SODP_RecordID),"'+parent.currentChoose+'"):0

2014年3月18日 星期二

javascript-jsp javascript-asp jquery-jsp jquery-asp

javascript-jsp
javascript-asp
jquery-jsp
jquery-asp


$.getJSON('getDate?callback=?',
function(data) {
if (data[0]){
for (r=0 ; r<data.length; r++)
{
//alert(data[0][0]);
//obj_field.options[r+1] = new Option(data[r][0],data[r][1]);
}
}
}
)







There are multiple possibilities in invoking a JSP page from JavaScript.

1) Opening the JSP page in a separate popup window using JavaScript function - window.open()
window.open("MyPage.jsp?param1=value1&param2=value2","pageName","height=400,width=400");
2) Redirecting to the JSP page when the form is submitted.
document.forms[0].action = "MyPage.jsp";
document.forms[0].method = "post"; // "get"
document.forms[0].submit();
3) Clicking on a hyperlink which will redirect to another page.
<a href="MyPage.jsp?param1=value1&param2=value2">My Page</a>

javascript-iframe-call-parent-click

in the parent window:
  1. <script>
  2. function OnFrameButtonClick () {
  3. alert ("You clicked on a button in the frame");
  4. }
  5. </script>
in the child frame window:
  1. <head>
  2. <script>
  3. function OnButtonClick () {
  4. // check whether the parent window and the OnFrameButtonClick method exist
  5. if (window.parent && parent.OnFrameButtonClick) {
  6. parent.OnFrameButtonClick ();
  7. }
  8. }
  9. </script>
  10. </head>
  11. <body>
  12. <button onclick="OnButtonClick ()">Test</button>
  13. </body>
You can find further examples on the following sites:

2014年3月16日 星期日

jquery-menu-click

click to change colour


 $('a[class="oe_menu_leaf"]').click(function(){
$(".oe_menu_leaf").css('color','');
$(".oe_menu_leaf").css('background-color','');
$(this).css('color','black');
$(this).css('background-color','#00FFFF');
});

2014年3月15日 星期六

asp-code-value update ajax

if 1=0 then
response.write("<span>Customer : </span>")
'response.write("<span>"&Pcus &"</span>")
SQLStmt.CommandText="select name from customer where no_ ='" &pcus&"'"
SQLStmt.CommandType = 1
RS.Open SQLStmt
if  Not RS.EOF   then
CUSNAM=rs("name")
response.write(CUSNAM)
end if
rs.close
end if

2014年3月11日 星期二

itext-no-underline itext-table-setting

PdfPTable tablex1=new PdfPTable(2);
tablex1.getDefaultCell().setBorder(Rectangle.NO_BORDER);
tablex1.setSpacingBefore(15f);
tablex1.setTotalWidth(300);
tablex1.setLockedWidth(true);

PdfPCell cell = new PdfPCell(new Paragraph("header with colspan 3"));
cell.setBackgroundColor($hdr2BgColor);
cell.setHorizontalAlignment(Element.ALIGN_RIGHT); 
tablex1.addCell(cell);

PdfPCell cell = new PdfPCell(new Paragraph("header with colspan 3"));
cell.setBackgroundColor($hdr2BgColor);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
tablex1.addCell(cell);


document.add(tablex1);

2014年3月9日 星期日

erp-map

index.jsp
--> LoginCheck.jsp
      bean.setAdmin("true")
      bean.setAdmin("false")
--> Menu3.jsp
     <%@ include file="userSettingScreen.html" %>
     <%@ include file="userLogoutScreen.html" %>
     <%@ include file="userPasswordScreen.html" %>
     <%@ include file="userRoleScreen.html" %>
     <%@ include file="userActiveScreen.html" %>
     <%@ include file="userAddScreen.html" %>

     <%@ include file="paymentSubMenu.js" %>
     <%@ include file="supplierInvoiceSubMenu.js" %>
     <%@ include file="dNotesSubMenu.js" %>
     <%@ include file="currencySubMenu.js" %>
     <%@ include file="paymentMethodSubMenu.js" %>
     <%@ include file="paymentTermsSubMenu.js" %>
     <%@ include file="salesOrdersSubMenu.js" %>
     <%@ include file="purchaseOrdersSubMenu.js" %>
     <%@ include file="userSettingValidateForm.js" %>
     <%@ include file="userPasswordValidateForm.js" %>
     <%@ include file="userRoleValidateForm.js" %>
     <%@ include file="userAddValidateForm.js" %>
     <%@ include file="vendorsSubMenu.js" %>
     <%@ include file="customersSubMenu.js" %>
     <%@ include file="productsSubMenu.js" %>
     <%@ include file="paymentSubMenu.js" %>
     <%@ include file="supplierInvoiceSubMenu.js" %>
     <%@ include file="dNotesSubMenu.js" %>
     <%@ include file="currencySubMenu.js" %>
     <%@ include file="paymentMethodSubMenu.js" %>
     <%@ include file="paymentTermsSubMenu.js" %>
     <%@ include file="salesOrdersSubMenu.js" %>
     <%@ include file="purchaseOrdersSubMenu.js" %>
     <%@ include file="userSettingValidateForm.js" %>
     <%@ include file="userPasswordValidateForm.js" %>
     <%@ include file="userRoleValidateForm.js" %>
     <%@ include file="userAddValidateForm.js" %>
     <%@ include file="vendorsSubMenu.js" %>
     <%@ include file="customersSubMenu.js" %>
     <%@ include file="productsSubMenu.js" %>



2014年3月7日 星期五

mssql-earlyWorkingDay

CREATE FUNCTION dbo.earlyWorkngDay
(
    @StartDate DATETIME
    --@noOfDate  int = 3 --@EndDate replaced by @StartDate when DEFAULTed
)
--Define the output data type.
RETURNS DATETIME

AS
--Calculate the RETURN of the function.
BEGIN

DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
declare @Holiday table(holiday datetime)
DECLARE @intFlag INT
DECLARE @T_DATE DATETIME
DECLARE @M_DATE DATETIME
DECLARE @M_COUNT INT
DECLARE @RR INT
SELECT @M_DATE='2014/04/04'
SELECT @T_DATE=@StartDate
SET @path = 'C:\Backup\'
DECLARE db_cursor CURSOR FOR
select actual_date,count from datetable
OPEN db_cursor  
FETCH NEXT FROM db_cursor INTO @M_DATE ,@M_COUNT
WHILE @@FETCH_STATUS = 0  
BEGIN  
SELECT @RR=0
WHILE @RR<@M_COUNT
BEGIN
insert into @Holiday (holiday) values (@M_DATE+@RR)
SELECT @RR=@RR+1
END
    FETCH NEXT FROM db_cursor INTO  @M_DATE ,@M_COUNT
END  

SET @intFlag = 1
WHILE (@intFlag <=15)
BEGIN
IF (NOT EXISTS(SELECT * FROM @holiday WHERE holiday = @T_date))
and DATENAME(dw, @T_Date) != 'Saturday'
and DATENAME(dw, @T_Date) != 'Sunday'
BEGIN
break
END
ELSE
BEGIN
set @T_date=@T_date +1
END

SET @intFlag = @intFlag + 1
END

-- select * from @Holiday
CLOSE db_cursor  
DEALLOCATE db_cursor
   RETURN (
@T_date
    )
end
go