function reportCard(node) { window.open("matchcard.php?id=" + node); } <?php } } $crud = new MatchCrud(); $crud->dialogwidth = 450; $crud->title = "Match Details"; $crud->allowAdd = false; $crud->allowEdit = isUserInRole("SUPERUSER"); $crud->allowRemove = false; $crud->allowFilter = false; $crud->allowView = false; $crud->table = "{$_SESSION['DB_PREFIX']}matchdetails"; if (isUserInRole("ADMIN")) { $crud->sql = "SELECT A.*, A.id AS uniqueid,\n\t\t\t\t\t B.name AS refereename, C.age,\n\t\t\t\t\t C.name AS submittedteamname\n\t\t\t\t\t FROM {$_SESSION['DB_PREFIX']}matchdetails A\n\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}referee B\n\t\t\t\t\t ON B.id = A.refereeid\n\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}teamagegroup C\n\t\t\t\t\t ON C.id = A.teamid\n\t\t\t\t\t ORDER BY A.id DESC"; } else { if (isUserInRole("SECRETARY")) { $clubid = getLoggedOnClubID(); $crud->sql = "SELECT A.*, A.id AS uniqueid,\n\t\t\t\t\t B.name AS refereename, C.age,\n\t\t\t\t\t C.name AS submittedteamname\n\t\t\t\t\t FROM {$_SESSION['DB_PREFIX']}matchdetails A\n\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}referee B\n\t\t\t\t\t ON B.id = A.refereeid\n\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}teamagegroup C\n\t\t\t\t\t ON C.id = A.teamid\n\t\t\t\t\t WHERE C.teamid = {$clubid};\n\t\t\t\t\t ORDER BY A.id DESC"; } else { $teamid = getLoggedOnTeamID(); $crud->sql = "SELECT A.*, A.id AS uniqueid,\n\t\t\t\t\t B.name AS refereename, C.age,\n\t\t\t\t\t C.name AS submittedteamname\n\t\t\t\t\t FROM {$_SESSION['DB_PREFIX']}matchdetails A\n\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}referee B\n\t\t\t\t\t ON B.id = A.refereeid\n\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}teamagegroup C\n\t\t\t\t\t ON C.id = A.teamid\n\t\t\t\t\t WHERE A.teamid = {$teamid};\n\t\t\t\t\t ORDER BY A.id DESC"; } } $crud->columns = array(array('name' => 'matchdate', 'length' => 12, 'datatype' => 'date', 'label' => 'Match Date'), array('name' => 'ageref', 'function' => 'ageReference', 'sortcolumn' => 'C.age', 'type' => 'DERIVED', 'length' => 10, 'editable' => false, 'bind' => false, 'filter' => false, 'label' => 'Age Group'), array('name' => 'division', 'length' => 17, 'label' => 'Division / Group', 'type' => 'COMBO', 'options' => array(array('value' => 'X', 'text' => 'N/A'), array('value' => 'P', 'text' => 'Premier'), array('value' => '1', 'text' => '1'), array('value' => '2', 'text' => '2'), array('value' => '3', 'text' => '3'), array('value' => '4', 'text' => '4'), array('value' => '5', 'text' => '5'), array('value' => '6', 'text' => '6'), array('value' => 'A', 'text' => 'A'), array('value' => 'B', 'text' => 'B'), array('value' => 'C', 'text' => 'C'), array('value' => 'D', 'text' => 'D'), array('value' => 'E', 'text' => 'E'), array('value' => 'F', 'text' => 'F'), array('value' => 'G', 'text' => 'G'), array('value' => 'H', 'text' => 'H'))), array('name' => 'leaguecup', 'length' => 15, 'label' => 'Competition', 'type' => 'COMBO', 'options' => array(array('value' => 'L', 'text' => 'League'), array('value' => 'N', 'text' => 'Combination'), array('value' => 'C', 'text' => 'Challenge Cup'), array('value' => 'T', 'text' => 'Challenge Trophy'))), array('name' => 'hometeam', 'length' => 28, 'editable' => false, 'bind' => false, 'label' => 'Home Team'), array('name' => 'hometeamscore', 'length' => 5, 'align' => 'center', 'label' => 'Score'), array('name' => 'opposition', 'length' => 28, 'editable' => false, 'bind' => false, 'label' => 'Away Team'), array('name' => 'awayteamscore', 'length' => 5, 'align' => 'center', 'label' => 'Score'), array('name' => 'id', 'length' => 5, 'filter' => false, 'bind' => false, 'editable' => false, 'pk' => true, 'label' => 'ID'), array('name' => 'teamid', 'type' => 'DATACOMBO', 'length' => 28, 'label' => 'Submitted By Team', 'table' => 'teamagegroup', 'required' => true, 'table_id' => 'id', 'alias' => 'submittedteamname', 'table_name' => 'name')); $crud->subapplications = array(array('title' => 'Match Result Form', 'imageurl' => 'images/print.png', 'script' => 'reportCard')); $crud->run();
<?php } if (isUserInRole("SECRETARY")) { ?> <OPTION value="TEAM">Manager</OPTION> <?php } ?> </SELECT> </td> </tr> <tr id="clienttype" style="display:none"> <td>Team</td> <td> <?php createCombo("teamid", "id", "name", "{$_SESSION['DB_PREFIX']}teamagegroup", "WHERE teamid = " . getLoggedOnClubID(), false); ?> </td> </tr> <tr id="sectype" style="display:none"> <td>Club</td> <td> <?php createCombo("clubid", "id", "name", "{$_SESSION['DB_PREFIX']}team", "", false); ?> </td> </tr> <tr> <td>User Name</td> <td><input required="true" name="login" type="text" class="textfield logintext" id="login" /></td> </tr>