Self-analysis to witness your growth ..
Bank insurance project summary:
1. No system analysis of all processes before development
2. unclear ideas
3. A lot of things are forgotten, which leads to low efficiency and unfamiliar use of development tools.
Learning Skills:
Once there is an operation, it is necessary to analyze all the processes of the operation;
All web projects are
1. Verify data
2. Clear Data
3. Get value (jquery)
4. input the background (Form, Ajax, a tag href, Action)
5. backend processing incoming Database
6. database operation function, reuse select_paramindex_returnparam
7. Pass the value (Out. Print ())
8. Display
The preceding steps are all based on:
1. Every operation must analyze every possibility
2. Illegal operation (foreground), failed operation (background), successful operation (background)
Jquery
The understanding of jquery is based on the first position, then filtering, and then changing the status.
$ ("# Parentid child [ATTR = attrvalue]")
. ATTR ("attrname", "attrvalue)
. CSS ("cssname", "cssvalue ")
. Html ("htmlvalue ");
Jquery Ajax JSON knowledge
1. jquery. JS, JSON. JS, and json6 packages
2. Foreground format
Front-end
$. Ajax ({
URL: "test. Action ",
Data: {Name: zhangsan, age: 20} // note
Type: "Post ",
Datatype: "JSON ",
Success: function (MSG ){
$. Each (MSG, function (idx, item ){
//... Idx traversal number, item current traversal information;
})
}
})
3. Background format
Background
Responsesetcontenttype ("text/JavaScript; charset = GBK"); // note
// Single
Out. Print (jsonobject. fromobject ("{Name: 'hangsan', age: '20'}"). tostring (); // note
// Array
Arraylist <string> List = new arraylist <string> ();
List. Add ("{Name: 'hangsan ', age: '20 '}");
List. Add ("{Name: 'lisi', age: '21 '}");
Out. Print (josnarray. fromobject (list). tostring (); // note
Ajax loads thousands of data records, rendering in ie9 slows down chrome generally around 1 s
$ ("# Table" ).html ()> JS> jquery rendering speed
1. Multi-Purpose ID selector, less class, And tagname
2. Multi-Purpose chained operation
3. Bind and insert
$. Ajax ({
URL: "test. Action ",
Data: {Name: zhangsan, age: 20}
Type: "Post ",
Datatype: "JSON ",
Success: function (MSG ){
$. Each (MSG, function (idx, item ){
VaR htmlstr = "<tr> <TD>" + item. name + "</TD> <TD>" + item. age + "</TD> <TD>" + item. hobbit + "</TD> <TD>" + item. height + "</TD> </tr> ";
$ ("# Table" pai.html (htmlstr );
})
}
})
Get jquery Value
$ ("# Select"). Val ();
$ ("# Select option: Selected"). Text ();
$ ("# Select"). Get (0). selectedindex;
$ ("# Select"). Val ("zhangsan ");
$ ("# Select option [TEXT = ABC]"). ATTR ("selected", true );
// $ ("# Checkbox_parent"). Change (function () {same effect
$ ("# Checkbox_parent"). Click (function (){
// $ ("# Checkbox_child"). ATTR ("checked", true); // select all
// $ ("# Checkbox_child"). ATTR ("checked", false); // none
// $ (": Checkbox [ID = checkbox_child]"). ATTR ("checked", $ ("# checkbox_parent "). ATTR ("checked"); // synchronously select
// $ (": Checkbox [ID = checkbox_child]"). ATTR ("checked ",! $ (": Checkbox [ID = checkbox_child]"). ATTR ("checked"); // do not select synchronously
// $ (": Checkbox [ID = checkbox_child]"). Each (function () {; // reselect
// $ (This). ATTR ("checked ",! $ (This). ATTR ("checked "));
//})
// $ (": Checkbox [ID = checkbox_child]: checked "). each (function () {alert ($ (this ). ATTR ("value");}) // selected value
$ (": Checkbox [ID = checkbox_child]"). each (function () {if ($ (this ). ATTR ("checked") = false) Alert ($ (this ). ATTR ("value");}) // unselected Value
})
When multiple groups exist in the checkbox
One checkbox_parent and multiple checkbox_child
You can use $ ("# checkbox_child") to obtain only the first data.
Because document. getelementbyid () returns a single data
$ (": Checkbox [ID = checkbox_child]") returns all Id = checkbox_child data in the checkbox.
Getelementbytagname () is used to return multiple data;
$. Each (function (){
$ (This) // The current subscript object;
})
TIPS:
1. End () returns the element of the previous operation.
2. Find () to find child elements
3. Use break continue in. Each () to replace it.
Return false; --> break;
Return true; --> continue;
Java Regular Expression
Pattern. Matches (Reg, STR );
* --> 0
+ --> 1
A very convenient Verification
// Var Reg =/[^ 0-9] +/g;
Function vali (OBJ, Reg ){
VaR v = $ (OBJ). Val ();
If (Reg. Test (V )){
$ (OBJ). Val (V. Replace (Reg ,""));
}
}
Informix Database
1. Select skip m first n name from student; // page M skips M pieces of data and obtains the next n pieces of data;
2. Another method of grouping
Select name, age from student S1 where name in // group by class to get the name of the person in each class;
(Select name from student where class = s1.class );
3. Stored Procedure
------------ Basic -----
Drop procedure pro_test1 (INT );
Create procedure pro_test1 (var_num INT)
Returning int;
Define temp1 int;
Let temp1 = 9;
Return temp1;
End procedure;
------------- Return value of the query
-- Drop procedure pro_test (char (50); -- shz31405
-- Create procedure pro_test (var_num char (50 ))
-- Returning char (30 );
-- Define temp1 char (30 );
-- Select username into temp1 from shz_appusers where userid = var_num;
-- Return temp1;
-- End procedure;
Execute procedure pro_test ('shz31405 ');
------------------------ Insert operation-no return value ---------
Drop procedure pro_insert (char (30 ));
Create procedure pro_insert (var_num char (30 ))
Define temp_ I
Insert into shz_appusers (username) values (var_num );
-- Updata from shz_appusers set userid = '1' where username = var_num;
End procedure;
------------------
-------- Condition ----------
If (condition) then
Statements
Elif (condition) then
Statements
...
Else
Statements
End if;
-------- Instance ---
Drop procedure pro_if (INT );
Create procedure pro_if (var_if INT)
Returning char (30 );
Define result_if char (30 );
If var_if = 0 then
Let result_if = 'success! ';
Elif var_if = 1 then
Let result_if = 'failed! ';
Else
Let result_if = 'nofind ';
End if
Return result_if;
End procedure;
Execute procedure pro_if (10 );
-- Foreach ------------
Foreach select salary into ind_sal
From customer
Where location = "UK"
Sum_sal + = ind_sal;
End foreach;
Retrun sum_sal; 6) continue or exit statement
Can be used in for, foreach, and while loop statements.
The reference example is as follows:
For I = 1 to 5
Let J = I;
While (j> 0)
Let id = Foo (j );
If (ID = 5) then
Let J = J-1;
Continue while; -- do not execute subsequent operations, continue back to the while loop and then execute
End if;
Let sum = sum + 5;
Let J = J-1;
If (sum & gt; 500) then
Exit for; -- exit the For Loop
End if;
End while;
End;
Return sum;
-------- Instance ---
Drop procedure pro_foreach;
Create procedure pro_foreach (var_foreah INT)
Returning char (30), char (50 );
Define UN char (30 );
Define UI char (50 );
Foreach select username, userid into UN, UI from shz_appusers where userid = var_foreach
End foreach;
End procedure;
------ While loop ------
While (conditional expression)
Executed statement
An example of the conditional expression in end while; while is as follows:
While (count <20)
While (status matches "*")
While (exists (Select name from customer where cus_num = 100 ))
While (status in ("A", "I", "D "))
-------- Instance ---
Drop procedure pro_while (INT );
Create procedure pro_while (var_while INT)
Returning int;
Define idx int;
Let idx = 1;
While var_whereas <100
Let idx = idx + 1;
Let var_while = var_while + 1;
End while;
Return idx;
End procedure;
Execute procedure pro_while (10 );
-- Loop-----
For Count = 2 to 30
For Count = 2 to 30 step 2
For count in (2, 5, 7, 9)
For count in (2 to 8 step 2, 12 to 19, 22)
For name in ("Amy", "Max ",
(Select name from customer where customer_num = 100 ))
-------- Instance ---
Drop procedure pro_for (INT );
Create procedure pro_for (var_ I INT)
Returning int;
Define I int;
For I = 1 to 10
Let var_ I = var_ I + 1;
End
Return var_ I;
End procedure;
Execute procedure pro_for (10 );
--------------- Returns the multiline value cursor ---------------------------------
Drop procedure pro_dele;
Create procedure pro_dele ()
Define p_time date;
Begin work;
Foreach curl
-- Update the cursor must be named
Select time_stamp into p_time from pro_dele_tbl
Where num> 100
If p_time is not null then
Delete from pro_del_tbl where current of curl;
-- Delete the current record
End if;
End foreach;
Commit work;
-- The locks of all modified records are released.
End procedure;
--------------- Multiple rows with resume ---------------------------------
Drop procedure count_add; -- delete a stored procedure
Create procedure count_add (user_name_var varchar (50) default 'admin ')
-- User_name_var parameter variables are defined here
Returning varchar (50 );
-- Returns a struct value.
Define error_count_var integer;
---- Define the number of input variable
Select error_count into error_count_var from users where user_name = user_name_var;
---- Error_count the default value is 0 and starts from 0.
Let error_count_var = error_count_var + 1;
---- Input one count plus 1
Update users set error_count = error_count_var where user_name = user_name_var;
Return user_name_var;
-- Return the variable value, which corresponds to returning.
Return user_name_var with resume;
---- The stored procedure will continue to be executed, and all the variables will keep their original values
End procedure
Bank Protection Project Summary