|
|
@@ -348,6 +348,17 @@ jQuery(document).ready(function () {
|
|
|
)
|
|
|
group by `t1`.`ID_PROJECT`, `t1`.`MONTH`
|
|
|
";
|
|
|
+ foreach($sql as $ind=>$sql_) {
|
|
|
+
|
|
|
+
|
|
|
+ DEBUG_S(-3,'wykonuje zapytanie sql dla '.$ind,$sql_,__FILE__,__FUNCTION__,__LINE__);
|
|
|
+ if(!empty($DB)) {
|
|
|
+ $DB->query($sql_) or die('Problem z zapytaniem '.mysql_error());
|
|
|
+ } else {
|
|
|
+ DB::query($sql_) or die('Problem z zapytaniem '.mysql_error());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public function test_fetchDataFromTables() {
|
|
|
@@ -450,8 +461,8 @@ jQuery(document).ready(function () {
|
|
|
* Read from TABLE `IN7_DZIENNIK_KORESP`
|
|
|
*/
|
|
|
function test_reinstallViewsAndEvents() {
|
|
|
- $sqls['RemoveView_korespMain'] = " drop view if exists `in7_dziennik_koresp_budget_main_view` ";
|
|
|
- $sqls['CreateView_korespMain'] = "
|
|
|
+ $sqlList['RemoveView_korespMain'] = " drop view if exists `in7_dziennik_koresp_budget_main_view` ";
|
|
|
+ $sqlList['CreateView_korespMain'] = "
|
|
|
CREATE VIEW `in7_dziennik_koresp_budget_main_view` AS
|
|
|
select cast(substring_index(substring_index(k.`path`,'-',2),'-',-(1)) as signed) AS `ID`
|
|
|
, substring_index(k.`path`,'-',2) AS `path`
|
|
|
@@ -504,8 +515,8 @@ jQuery(document).ready(function () {
|
|
|
where (k.`COST_VALUE` <> '')
|
|
|
group by substring_index(k.`path`,'-',2)
|
|
|
";
|
|
|
- $sqls['RemoveView_korespMain'] = " drop view if exists `in7_dziennik_koresp_budget_view` ";
|
|
|
- $sqls['CreateView_korespMain'] = "
|
|
|
+ $sqlList['RemoveView_korespMain'] = " drop view if exists `in7_dziennik_koresp_budget_view` ";
|
|
|
+ $sqlList['CreateView_korespMain'] = "
|
|
|
CREATE or replace VIEW `in7_dziennik_koresp_budget_view` AS
|
|
|
select k.`ID` AS `ID`
|
|
|
, k.`path` AS `path`
|
|
|
@@ -576,6 +587,19 @@ jQuery(document).ready(function () {
|
|
|
LEFT JOIN IN7_MK_BAZA_DYSTRYBUCJI AS t2 ON(t1.ID=t2.ID);
|
|
|
END
|
|
|
";
|
|
|
+ foreach($sqlList as $ind=>$sql_) {
|
|
|
+
|
|
|
+
|
|
|
+ DEBUG_S(-3,'wykonuje zapytanie sql dla '.$ind,$sql_,__FILE__,__FUNCTION__,__LINE__);
|
|
|
+ if(!empty($DB)) {
|
|
|
+ $DB->query($sql_) or die('Problem z zapytaniem '.mysql_error());
|
|
|
+ } else {
|
|
|
+ DB::query($sql_) or die('Problem z zapytaniem '.mysql_error());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|