Created
November 23, 2012 16:04
-
-
Save asanchez75/4136262 to your computer and use it in GitHub Desktop.
AA_Stringexpand_Selectbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AA_Stringexpand_Selectbox extends AA_Stringexpand { | |
function expand() { | |
$group_id = 'NIVELPROCESOS'; | |
$fid = 'category.......7'; | |
$categ = 1; | |
$return_url = "http://www.google.com"; | |
$form .= ''; | |
$form .= "<form action=\"\" method=\"post\" name=\"form-tipo-procesos\" id=\"form-tipo-procesos\">"; | |
$form .= "<input type=hidden name=\"AA_CP_Session\" value=\"" . $AA_CP_Session . "\">"; | |
$form .= "<input type=hidden name=\"group_id\" value=\"" . $group_id . "\">"; | |
$form .= "<input type=hidden name=\"fid\" value=\"" . $fid . "\">"; | |
$form .= "<input type=hidden name=\"categ\" value=\"" . $categ . "\">"; | |
$form .= "<input type=hidden name=\"return_url\" value=\"" . $return_url . "\">"; | |
$form .= "<table>"; | |
$db = new DB_AA(); | |
$db->query("SELECT * FROM constant WHERE group_id = '" . $group_id . "'"); | |
$i=0; | |
while($db->next_record()){ | |
$form .= AA_ShowConstant($i, $db->f('name'), $db->f('value'), unpack_id($db->f('id')), $db->f('pri')); | |
$i++; | |
} | |
for ($j=$i; $j<$i+10; $j++) { | |
$form .= AA_ShowConstant($j, "", "", new_id(), 1000+ $j*10); | |
} | |
$form .= "<tr><td><input type=\"submit\" value=\"Submit\" name=\"submit\" ></td></tr>"; | |
$form .= "</table></form>" . AA_Stars_jquery_code_submit(); | |
$form .= "<div id=\"resultado\"></div>"; | |
return $form ; | |
} | |
} | |
function AA_Stars_jquery_code_submit() { | |
$code = "<script>$(document).ready(function(){ | |
$(\"#form-tipo-procesos\").submit(function () { | |
$.post( | |
'/apc-aa/filler_constants.php', | |
$(this).serialize(), | |
function(data){ | |
// TO DO; | |
} | |
); | |
return false; | |
}); | |
});</script>"; | |
return $code; | |
} | |
function AA_ShowConstant($id, $name, $value, $cid, $pri) { | |
$name = safe($name); $value=safe($value); $pri=safe($pri); $cid=safe($cid); | |
return "<tr> | |
<td><input type=\"text\" name=\"name[$id]\" size=\"30\" maxlength=\"149\" value=\"$name\"></td> | |
<td><input type=\"text\" name=\"value[$id]\" size=\"30\" maxlength=\"255\" value=\"$value\"> | |
<input type=\"hidden\" name=\"cid[$id]\" value=\"$cid\"></td> | |
<td class=\"tabtxt\"><input type=\"text\" name=\"pri[$id]\" size=\"4\" maxlength=\"4\" value=\"$pri\"></td> | |
</tr>\n"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment