<?php
    include_once '../../account/session.php';
    include_once '../../../scripts/bd.php';
    
    if(isset($_GET['action'])){
        $action=$_GET['action'];
        if($action=='add')add();
        if($action=='show')show();
        if($action=='get')get();
        if($action=='set')set();
        if($action=='set_active_on')set_active_on();
        if($action=='set_active_off')set_active_off();
   }
   
   function show(){ 
      $list=array();
      $data= bd::query("SELECT id,name,provider,active FROM data_news WHERE id='{$_SESSION['id-news']}'");
      while ($row = mysql_fetch_object($data)) {
          $list[]=$row;
      }
      echo json_encode($list);
   }

