Пример #1
0
        echo 'Success';
    }
}
//Get Sponsor Data
if (isset($_POST['action']) && $_POST['action'] == 'get_agenda_sponsor_data') {
    $agenda = new agenda\agenda_main();
    $result = $agenda->get_sponsor_data($_POST['day'], $_POST['category']);
    if (isset($result)) {
        echo $result;
    }
}
//change sponsor type
if (isset($_POST['action']) && $_POST['action'] == 'change_sponsor_type') {
    $the_main = new main\main();
    $agenda = new agenda\agenda_main();
    $the_main->change_agenda_sponsor_type($_POST['day'], $_POST['category'], $_POST['type']);
    $result = $agenda->get_sponsor_data($_POST['day'], $_POST['category']);
    if (isset($result)) {
        echo $result;
    }
}
//add sponsor to agenda
if (isset($_POST['action']) && $_POST['action'] == 'add_sponsor_to_agenda') {
    $the_main = new main\main();
    $agenda = new agenda\agenda_main();
    $output = $the_main->add_sponsor_to_agenda($_POST['block_id'], $_POST['sponsor_id'], $_POST['type']);
    $result = $agenda->get_sponsor_data($output['agenda_day'], $output['agenda_category_id']);
    if (isset($result)) {
        echo $result;
    }
}