The result of multiple selections is as follows:
The Code is as follows:
Copy codeThe Code is as follows: <script type = "text/javascript"> <! --
$ (Document). ready (function (){
$ ("# Selectall"). click (selectAll );
});
Function selectAll (){
Var checked = $ ("# selectall"). attr ("checked ");
$ (". Selectable"). each (function (){
Var subchecked = $ (this). attr ("checked ");
If (subchecked! = Checked)
$ (This). click ();
});
}
// --> </Script>
<Table id = "detail-table" style = "width: 100%; background: # F0F8FF;">
<Thead>
<Tr>
<Th> <input id = "selectall" type = "checkbox"/> </th>
<Th style = "text-align: center" style = "text-align: center"> Item Name </th>
<Th style = "width: 60px; text-align: center"> UM </th>
<Th style = "width: 80px; text-align: center"> Ordered Qty </th>
<Th style = "width: 80px; text-align: center"> Received Qty </th>
<Th style = "width: 80px; text-align: center"> Quantity </th>
<Th style = "width: 120px; text-align: center"> Remark </th>
</Tr>
</Thead>
<? Php
$ I = 1;
Foreach ($ this-> details as $ item ){
Echo "<tr> \ n ";
Echo "<td width = '6px '> <input type = 'checkbox' id = 'item _ id $ I' name = 'item _ id $ I 'class = 'selectable' value = '". $ item ["item_id"]. "'/> </td> \ n ";
// Item name
Echo "<td> ". $ item ["item_name"]. "<input type = 'did' id = 'item _ id $ I 'name = 'item _ id $ I' value = '". $ item ["item_id"]. "'/> <input type = 'den den' id = 'item _ name $ I 'name = 'item _ name $ I' value = '". $ item ["item_name"]. "'/> </td> \ n ";
// Unit
Echo "<td>". $ item ["unit_name"]. "</td> \ n ";
// Ordered Qty
Echo "<td style =" text-align: right "style =" text-align: right "> ". $ item ["quantity"]. "</td> \ n ";
// Received Qty
Echo "<td style =" text-align: right "style =" text-align: right "> ". $ item ["received_qty"]. "</td> \ n ";
// Quantity
Echo "<td> <input style = 'width: 99%; text-align: right 'Type = 'text' id = 'quantity $ I 'name = 'quantity $ I' MaxLength = '4' OnKeyPress = 'ensuredecimal (this) '/> </td> \ n ";
// Remark column
Echo "<td> <input style = 'width: 99%; 'Type = 'text' id = 'remark $ I 'name = 'remark $ I' MaxLength = '30'> </td> ";
Echo "</tr> \ n ";
$ I ++;
}
?>
</Table>
Multiple Local selections, such
Code
Copy codeThe Code is as follows: <script type = "text/javascript"> <! --
Function selectAllMenu (cmb ){
Var checked = cmb. checked;
$ (". Selectable [model =" + cmb. model + "]"). each (function (){
Var subchecked = $ (this). attr ("checked ");
If (subchecked! = Checked)
$ (This). click ();
});
}
// --> </Script>
<? Php
If (isset ($ this-> user )){
Echo "}
Elseif (isset ($ this-> role )){
Echo "}
Else {
Echo "}
?>
<Form id = "form1" method = "post" action = "<? Php echo $ this-> baseUrl. '/admin/privilege/save';?> ">
<Center>
<Table class = "stripe" style = "text-align: left" style = "text-align: left" width = "80%">
<? Php
$ Model_name = "";
Foreach ($ this-> privileges as $ privilege ){
If ($ model_name! = $ Privilege ['model _ name']) {
$ Model_name = $ privilege ['model _ name'];
Echo "<tr> \ n ";
Echo "<td style = 'width: 20px '> <input model =' $ model_name 'class = 'selectall' type = 'checkbox' onclick = 'selectallmenu (this ); '/> </td> \ n ";
Echo "<td colspan = '2'> <B> $ model_name </B> </td> \ n ";
Echo "</tr> \ n ";
}
Echo "<tr> \ n ";
Echo "<td> </td> \ n ";
Echo "<td style = 'width: 20px '> <input model =' $ model_name 'Type = 'checkbox' class = 'selectable'/> </td> \ n ";
Echo "<td>". $ privilege ['display _ text']. "</td> \ n ";
Echo "</tr> \ n ";
}
?>
</Table>
</Center>
<Div style = "padding-top: 10px" style = "padding-top: 10px">
<? Php
$ Button_panel = new ButtonPanel ();
$ Button_panel-> setButtonAlign ("center ");
$ Button_panel-> addButton (array ("text" => "Save", "type" => "submit "));
$ Button_panel-> addButton (array ("text" => "Reset", "type" => "reset "));
$ Button_panel-> addButton (array ("text" => "Back", "onclick" => "window. history. back ();"));
$ Button_panel-> render ();
?>
</Div>
</Form>