<?php

if (isset($_GET['generalSubjectID'])) {
    $generalSubjectID = $_GET['generalSubjectID'];
} else {
    $generalSubjectID = '';
}
$generalSubject = new GeneralSubject(new NamedArguments(array('primaryKey' => $generalSubjectID)));
//get all users for output in drop down
$allDetailedSubjectArray = array();
$detailedSubjectObj = new DetailedSubject();
$allDetailedSubjectArray = $detailedSubjectObj->allAsArray();
//get Detail Subjects already set up for this General subject in case it's an edit
$dsSubjectArray = $generalSubject->getDetailedSubjects();
?>
		<div id='div_detailedSubjectForm'>
		<form id='detailedSubjectForm'>
		<input type='hidden' name='editgeneralSubjectID' id='editgeneralSubjectID' value='<?php 
echo $generalSubjectID;
?>
'>

		<div class='formTitle' style='width:280px; margin-bottom:5px;position:relative;'><span class='headerText'><?php 
echo _("Add / Edit Subject Relationships");
?>
</span></div>

		<span class='smallDarkRedText' id='span_errors'></span>

		<table class='noBorder' style='width:100%;'>
		<tr style='vertical-align:top;'>
<?php

$generalSubject = new GeneralSubject();
$generalSubjectArray = $generalSubject->allAsArray();
$detailedSubject = new DetailedSubject();
$detailedSubjectArray = $detailedSubject->allAsArray();
echo "<div class='adminRightHeader'>General Subject</div>";
if (count($generalSubjectArray) > 0) {
    ?>
			<table class='linedDataTable'>
				<tr>
				<th style='width:100%;'>Value</th>
				<th style='width:20px;'>&nbsp;</th>
				<th style='width:20px;'>&nbsp;</th>
				</tr>
				<?php 
    foreach ($generalSubjectArray as $instance) {
        echo "<tr>";
        echo "<td>" . $instance['shortName'] . "</td>";
        echo "<td><a href='ajax_forms.php?action=getGeneralSubjectUpdateForm&className=" . "GeneralSubject" . "&updateID=" . $instance[lcfirst("GeneralSubject") . 'ID'] . "&height=128&width=260&modal=true' class='thickbox'><img src='images/edit.gif' alt='edit' title='edit'></a></td>";
        $generalSubject = new GeneralSubject();
        if ($generalSubject->inUse($instance[lcfirst("GeneralSubject") . 'ID']) == 0) {
            echo "<td><a href='javascript:deleteGeneralSubject(\"GeneralSubject\", " . $instance[lcfirst("GeneralSubject") . 'ID'] . ");'><img src='images/cross.gif' alt='" . _("remove") . "' title='" . _("remove") . "'></a></td>";
        } else {
            echo "<td><img src='images/do_not_enter.png' alt='" . _("subject in use") . "' title='" . _("subject in use") . "' /></td>";
        }
        echo "</tr>";
    }
    ?>
			</table>
			<?php 
Example #3
0
	<tr>
	<td class='searchRow'><label for='searchDetailedSubjectID'><b>Detailed Subject</b></label>
	<br />
	<select name='search[detailedSubjectID]' id='searchDetailedSubjectID' style='width:150px'>
	<option value=''>All</option>

	<?php 
if ($search['detailedSubjectID'] == "none") {
    echo "<option value='none' selected>(none)</option>";
} else {
    echo "<option value='none'>(none)</option>";
}
$display = array();
$detailedSubject = new DetailedSubject();
foreach ($detailedSubject->allAsArray() as $display) {
    if ($search['detailedSubjectID'] == $display['detailedSubjectID']) {
        echo "<option value='" . $display['detailedSubjectID'] . "' selected>" . $display['shortName'] . "</option>";
    } else {
        echo "<option value='" . $display['detailedSubjectID'] . "'>" . $display['shortName'] . "</option>";
    }
}
?>
	</select>
	</td>
	</tr>
	
	<tr>
	<td class='searchRow'><label for='searchFirstLetter'><b>Starts with</b></label>
	<br />
	<?php