Skip to content

Instantly share code, notes, and snippets.

@asanchez75
Created November 23, 2012 16:04
Show Gist options
  • Save asanchez75/4136256 to your computer and use it in GitHub Desktop.
Save asanchez75/4136256 to your computer and use it in GitHub Desktop.
store constants list
<?php
/** APC-AA configuration file */
require_once "include/config.php3";
/** Main include file for using session management function on a page */
require_once AA_INC_PATH."locsess.php3";
/** Set of useful functions used on most pages */
require_once AA_INC_PATH."util.php3";
$AA_CP_Session = $_POST['AA_CP_Session'];
$group_id = $_POST['group_id'];
$name = $_POST['name'];
$value = $_POST['value'];
$cid = $_POST['cid'];
$pri = $_POST['pri'];
$db = new DB_AA();
$db->query("DELETE FROM constant WHERE group_id = '" . $group_id . "'");
foreach ($cid as $k => $v) {
if ($value[$k] !== '') {
$db->query("INSERT INTO constant(id, group_id, name, value, class, pri, ancestors, description, short_id) VALUES('" . $cid[$k] . "', '" . $group_id . "', '" . $name[$k] . "', '" . $value[$k] . "', '', '" . $pri[$k] . "', '', '', '');");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment