mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Use the database more efficiently
This commit is contained in:
@@ -37,6 +37,9 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
//initialize the database object
|
||||
$database = new database;
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
@@ -117,7 +120,7 @@
|
||||
$schema[$i]['fields'][] = $field_name;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,14 +249,13 @@
|
||||
|
||||
//user selected fields
|
||||
$fields = $_POST['fields'];
|
||||
|
||||
|
||||
//set the domain_uuid
|
||||
$domain_uuid = $_SESSION['domain_uuid'];
|
||||
|
||||
//get the users
|
||||
$sql = "select * from v_users where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$users = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
@@ -272,7 +274,7 @@
|
||||
foreach ($fields as $key => $value) {
|
||||
//get the line
|
||||
$result = str_getcsv($line, $delimiter, $enclosure);
|
||||
|
||||
|
||||
//get the table and field name
|
||||
$field_array = explode(".",$value);
|
||||
$table_name = $field_array[0];
|
||||
@@ -280,7 +282,7 @@
|
||||
//echo "value: $value<br />\n";
|
||||
//echo "table_name: $table_name<br />\n";
|
||||
//echo "field_name: $field_name<br />\n";
|
||||
|
||||
|
||||
//get the parent table name
|
||||
$parent = get_parent($schema, $table_name);
|
||||
|
||||
@@ -322,7 +324,6 @@
|
||||
if ($row_id === 1000) {
|
||||
|
||||
//save to the data
|
||||
$database = new database;
|
||||
$database->app_name = 'extensions';
|
||||
$database->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3';
|
||||
$database->save($array);
|
||||
@@ -342,7 +343,6 @@
|
||||
|
||||
//save to the data
|
||||
if (!empty($array) && is_array($array)) {
|
||||
$database = new database;
|
||||
$database->app_name = 'extensions';
|
||||
$database->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3';
|
||||
$database->save($array);
|
||||
@@ -458,4 +458,4 @@
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
Reference in New Issue
Block a user