X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/3a48d89e76fd2ab87dabf08632474c529cf77ad4..d5653b977ce2b9d0ef6e6c07b3a9b64c1462e601:/web/setup.php diff --git a/web/setup.php b/web/setup.php deleted file mode 100644 index 8fb989d..0000000 --- a/web/setup.php +++ /dev/null @@ -1,114 +0,0 @@ - false)))) { - - die('Не могу подключиться к БД'); - -} - -$db -> exec('SET CHARACTER SET utf8'); - -$selected = []; - -if ($_REQUEST['action']=='submit') { - - foreach($_REQUEST as $key=>$value) { - - if (strpos($key,'unit_')===0) { - - $group_id=intval(substr($key,5)); - $unit_id=$value; - setcookie('unit_'.$group_id,$unit_id,time()+86400*365*10); - $selected[$group_id]=$unit_id; - - } - - } - -?> - - - - - - WeatherMon (Настройки) - - - -

Сохранено...

- -$value) { - - if (strpos($key,'unit_')===0) { - - $group_id=intval(substr($key,5)); - $unit_id=$value; - setcookie('unit_'.$group_id,$unit_id); - $selected[$group_id]=$unit_id; - - } - - } - -?> - - - - - - WeatherMon (Настройки) - - - - - prepare( - 'select id,name,(select count(*) from units where unit_group=g.id) cnt from unit_groups g' -); -$q -> execute(); - -echo '
'; -while ($row = $q -> fetch(PDO::FETCH_ASSOC)) { - $group_id = $row['id']; - $group_name = $row['name']; - $group_cnt = $row['cnt']; - - echo '

'.$group_name.'

'; - - $q_p = $db -> prepare( - 'select id,name from units where unit_group='.$group_id - ); - - $q_p->execute(); - - echo '
'; -} -echo ''; -echo '

'; -echo '
'; - -} - -?> - - \ No newline at end of file