<?php /* ajax call - return all active companys for the actual date * krillo 2012-09-07 */ require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php"; error_reporting(E_ALL); ini_set('display_errors', '1'); !empty($_REQUEST['date']) ? $date = $_REQUEST['date'] : ($date = 'false'); //get all active companys, make checkboxes $compArray = Foretag::getAllActiveCompanys($date); $checkbox = ' <script type="text/javascript"> jQuery(document).ready(function(){ $("#all").click(function(event) { var all = $("#all:checked").val(); if(all === undefined){ $("[type=checkbox]").attr("checked", false); } else { $("[type=checkbox]").attr("checked", true); } }); }); </script>'; $checkbox .= '<table id=""><tr>'; $checkbox .= '<td><input type="checkbox" value="alla" id="all" name="all-companys" checked></td><td colspan="2"><label for="all">Alla eller ingen</label></td><tr/>'; $checkbox .= '<tr><th></th><th>Id</th><th>#</th><th>Företagsnamn</th><th>Tävlingsdatum</th><tr/>'; foreach ($compArray as $id => $comp) { $checkbox .= '<tr>
$am = 10; } if (isset($_POST['antal_steg'])) { $as = $_POST['antal_steg']; } else { $as = 49000; } if (isset($_POST['procent_pro'])) { $per = $_POST['procent_pro']; } else { $per = 1.0; } //get the array of companys !empty($_REQUEST['company']) ? $companyArray = $_REQUEST['company'] : ($companyArray = ''); //get all active companys, make checkboxes $copmArray = Foretag::getAllActiveCompanys(); $checkbox = '<input type="checkbox" value="alla" id="all" name="all-companys" checked><label for="all">Alla eller ingen</label><br/><br/>'; foreach ($copmArray as $id => $comp) { $checkbox .= '<input type="checkbox" value="' . $id . '" id="' . $id . '" name="company[]" checked><label for="' . $id . '">' . $id . ' <a href="/pages/editforetag.php?fid=' . $id . '&tab=2" >' . $comp[namn] . '</a></label><br/>'; } $smarty->assign('checkbox', $checkbox); $userArray = Medlem::getTavlingMedlemmar($stt, $slt, $am, $as, $per, $companyArray); //print_r($userArray); if (count($userArray) > 0) { $att = null; $emaillist = ''; $html = "<h2>"; foreach ($userArray as $arr) { foreach ($arr as $key => $value) { $att .= $value . "\t"; }