Tuesday, September 1, 2009

Save html data to csv file

To Save to CSV file just make a form wchich is call php page (which is build a csv file to download).
follow below steps:


Step 1
msqXLS +='form style="display:inline" action="SaveToCSV.php" method="post" target="_blank" onsubmit="$(\'#datatodisplay\').val( $(\'
\').append( $(\'#ReportTable\').eq(0).clone() ).html() )">';
msqXLS +='input_type="submit" value="Save as CSV">';
msqXLS +='
msqXLS +='Some header in csv vile, some header in csv file\n';
for (var i=0;i <>
msqXLS +=DataSource.getElementsByTagName('xxx')[i].firstChild.nodeValue+','+DataSource.getElementsByTagName('xx')[i].firstChild.nodeValue+'\n';
};
msqXLS +='"/>';

msqXLS +='

...
if require to print displayed data put content inside the printArea and call javacript "print()" to print it.

Step 2
And than create and paste below code in php file name it
"SaveToCSV.php"



Step 3
put all the file in htdocs, and then try call your ajax page from browser.

finally you will had csv file to download

Tuesday, July 7, 2009

How do I open a new browser window

Question: How do I open a new browser window?

Answer: To open a new browser window, use the window.open() method. For example, the following code opens this page in a new window.

myRef =window.open(''+self.location,'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0');

The general syntax of the window.open() method is as follows:

winRef = window.open( URL, name [ , features [, replace ] ] )

The return value, stored in the variable winRef, is the reference to your new window. You can use this reference later, for example, to close this window (winRef.close()), give focus to the window (winRef.focus()) or perform other window manipulations.

The parameters URL, name, features, replace have the following meaning:
URL String specifying the location of the Web page to be displayed in the new window. If you do not want to specify the location, pass an empty string as the URL (this may be the case when you are going to write some script-generated content to your new window).
name String specifying the name of the new window. This name can be used in the same constructions as the frame name provided in the frame tag within a frameset . For example, you can use hyperlinks of the form, and the hyperlink destination page will be displayed in your new window.

If a window with this name already exists, then window.open() will display the new content in that existing window, rather than creating a new one.

features An optional string parameter specifying the features of the new window. The features string may contain one or more feature=value pairs separated by commas.

replace An optional boolean parameter. If true, the new location will replace the current page in the browser's navigation history. Note that some browsers will simply ignore this parameter.

The following features are available in most browsers:
  • toolbar=0|1 Specifies whether to display the toolbar in the new window.
  • location=0|1 Specifies whether to display the address line in the new window.
  • directories=0|1 Specifies whether to display the Netscape directory buttons.
  • status=0|1 Specifies whether to display the browser status bar.
  • menubar=0|1 Specifies whether to display the browser menu bar.
  • resizable=0|1 Specifies whether the new window is resizable.
  • width=pixels Specifies the width of the new window.
  • height=pixels Specifies the height of the new window.
  • top=pixels Specifies the Y coordinate of the top left corner of the new window. (Not supported in version 3 browsers.)
  • left=pixels Specifies the X coordinate of the top left corner of the new window. (Not supported in version 3 browsers.)

Friday, July 3, 2009

MIB Structur for OID 1.3.6.1.2.1

File/Data retrive from NE

In some case to get the data, we have to retrieve it from NE directly.
Below will be some sample of how to get data from NE, specially performance data.

SNMP Data.
any data for SNMP protocol will store at OID (Object ID) in MIB Files, to get it we should used SNMP Browser. From SNMP Browser (i.e. Advannet) we should add the MIB files and than go to the specific OID. When retrieve command click the MIB Browser will do snmpwalk to NE and get the Data for those particular OID (this is how the MIB browser worked). Manually we are also can do snmpwalk directly using bellow command:
snmpwalk -v 1 -c public 192.161.x.xxx 1.3.6.1.4.1.9.2.1.57
desc:
-v = using SNMP Version
1 = is the version value
-c = using community string
public = community string value
1.3.6.1.4.1.9.2.1.57 = OID (Object ID)


Sample snmpwalk command
  • snmpwalk -v 1 -c public 192.161.x.xxx
  • Will get all the data from those ip under public community string
  • snmpwalk -v 1 -c public 192.161.x.xxx 1.3.6.1.4.1.9.2.1.57
  • Will get all the data under this 1.3.6.1.4.1.9.2.1.57 OID
  • snmpwalk -v 1 -c public 192.161.x.xxx 1.3.6.1.4.1.9.2.1.57.1
  • Will get all the data only from this 1.3.6.1.4.1.9.2.1.57 OID

Linux Command

To check if the port are used

netstat -na |grep 9992
netstat -na |grep 9891

To run java modul

java -classpath lib/HTTP_Prov.3.0.jar:lib/axis.jar:lib/jaxrpc.jar:lib/commons-logging-
1.0.4.jar:lib/commons-discovery-0.2.jar:lib/saaj.jar:lib/wsdl4j-1.5.1.jar:lib/HTTP_Prov.2.0.jar com.tango_tele.www.vas.schemas.smsfs.provisioning.SMSFSProvisioningImpl

above code will run SMSFSProvisioningImpl class, which is build up in this module com.tango_tele.www.vas.schemas.smsfs.provisioning


java -classpath lib/HTTP_Prov.3.0.jar:lib/axis.jar:lib/jaxrpc.jar:lib/commons-logging-
1.0.4.jar:lib/commons-discovery-0.2.jar:lib/saaj.jar:lib/wsdl4j-1.5.1.jar:lib/HTTP_Prov.2.0.jar etc/TANGO_SMSC_PROV_READ.xml

above code will execute TANGO_SMSC_PROV_READ.xml through HTTP_Prov.2.0.jar

To check your tools, write down:
echo $TERM
to know your session configuration type:
set

to check such a proses running on your machine
ps -ef
or pe -ef |grep KnownProses

once you get pid, and you want to see what is the proses, type:
grep pid_number var/run/*

to see all running proses check it with command:
ls var/run
to get the PID for some proses type:
more var/run/instance.pid

to restart the proses type:
kill -HUP pid_number

to kill the proses type:
kill -9 pid_number

to check your CPU proses status, type:
prstat -a

Huawei network connection with Telnet

To connect to Huawei HLR use below commnad

telnet 192.168.xx.xxx xxxxx
LGI: OPNAME="userName", PWD="Pasword";


To connect Huwawei IN use below command;
telnet 192.168.xxx.xx xxxxx
`SC`00581.00internalSRVM 00000002DLGLGN000000000001TXBEG 000LOGIN:PSWD=password,USER=userName checkSum


To connect Huwawei SMSC use below command;
telnet 172.27.xxx.xx xxxxx
login:accountname="xx",pwd="";

Wednesday, July 1, 2009

New Customer Provisioning


Flow Provisioning:

1. IN, to register the customer DN Number
2. HLR, to activate the customer DN
3. IPCG, to register data services
4. CRBT, SMSC, depend on services used by the customer

1. IN Provisioning
Only Prepaid customer in IN which have information about balance and validity (expired periods). If user want to use service like call or something, it will check HLR and at the same time goes to IN to check the balance and validity period.

2. HLR Provisioning
HLR is the master DB for all kind of customer (prepaid and postpaid), it has all kind of user information, i.e.:
- Customer registration data
- Barring label, roaming label
- Authentication of services like,
If customer want to use SMS, CBRT or other service it should be provisioning SMS, CBRT as well as authenticated in HLR

If user want to call, so first service will go HLR to check the authentication, to see wither the customer is authenticated or not for particular services.

3. IPCG
To provide data service to get data/image (any kind of data) thought NET(internet).

4. CRBT, SMSC
it’s just additional service base on customer requirement

Requirement to do provisioning:
1. DN Number
2. IMSI Number
3. Service plan (like prepaid, postpaid, etc)
4. ESN Number (Electronic Serial Number)
5. AKey Number ( Auth key)
6. COS (Class of service)
7. Expired date