Ejemplo n.º 1
0
function EditStatus($member_id)
{
    global $db;
    $form = new BayonetForm("", "POST");
    if ($form->VerifySubmit('processed')) {
        echo "Please wait while your information is being processed...";
        $status_id = $form->request['status'];
        $db->query("UPDATE `rudi_unit_members` SET `status_id` = '{$status_id}' WHERE `member_id` = '{$member_id}' LIMIT 1");
        PageRedirect(1, "?op=adjutant&edit=loas&member={$member_id}");
        return;
    }
    $result = $db->Query("SELECT * FROM `rudi_unit_members` JOIN `rudi_ranks` ON rudi_unit_members.rank_id=rudi_ranks.rank_id WHERE `member_id` = '{$member_id}' LIMIT 1");
    $row = $db->FetchRow($result);
    ?>
		<center>
		<table width="50%" style="text-align:center;">
		<tr><th>Rank</th><th>Soldier</th><th>Status</th></tr>
		<tr>
			<td><?php 
    echo $row['shortname'];
    ?>
</td>
			<td><?php 
    echo $row['first_name'] . " " . $row['last_name'];
    ?>
</td>
			<td style="text-align:left;">
				<?php 
    $form->radioButton('status', 1, $row['status_id'] == 1 ? true : false);
    ?>
Active<br />
				<?php 
    $form->radioButton('status', 2, $row['status_id'] == 2 ? true : false);
    ?>
On Leave<br />
				<?php 
    $form->radioButton('status', 3, $row['status_id'] == 3 ? true : false);
    ?>
On Extended Leave
			</td>
		</tr>
		<tr><td colspan="3"><?php 
    $form->submitButton('processed');
    ?>
</td></tr>
		</table>
		</center>
<?php 
    $form->__destruct();
}
Ejemplo n.º 2
0
    $text = $form->request['text'];
    $db->Query("UPDATE `rudi_awards` SET `name` = '{$name}', `description` = '{$text}' WHERE `award_id` = '{$award_id}' LIMIT 1");
    PageRedirect(1, "?op=rudi&show=awards&award={$award_id}");
    return;
}
echo LinkInternal("Cancel", "?op=rudi&show=awards&cid={$award['class_id']}");
OpenTable();
?>

<tr><th>Name:</th><td><?php 
$form->textField('name', $award['name'], false, "50");
?>
</td><tr>
<tr><th>Image:</th><td><?php 
?>
</td></tr>
<tr><th>Text:</th><td><?php 
$form->textArea('text', 10, 30, $award['description']);
?>
</td></tr>
<tr><td><?php 
$form->submitButton('processed', 'Update');
?>
</td></tr>

<?php 
CloseTable();
$form->__destruct();
?>

Ejemplo n.º 3
0
function AddAwardRecord($member_id)
{
    global $db;
    $form = new BayonetForm("", "POST");
    if ($form->verifySubmit('processed')) {
        $date = $form->request['date'];
        $details = $form->request['details'];
        $award_id = $_POST['award'];
        decho($form->request);
        $db->Query("INSERT INTO `rudi_award_record` SET `member_id` = '{$member_id}', `award_id` = '{$award_id}', `date_added` = '{$date}', `record_note` = '{$details}', `added_by` = 1");
        PageRedirect(1, "?op=rudi&show=members&award={$member_id}");
        return;
    }
    $result = $db->Query("SELECT `date_added`, `record_note`, `member_id` FROM `rudi_service_record` WHERE `record_id` = '{$record_id}' LIMIT 1");
    $row = $db->FetchRow($result);
    echo "<a href=\"?op=rudi&show=members&award={$member_id}\">Cancel</a>";
    OpenTable();
    ?>
	
		<tr><td>Award:</td><td>
		<select name="award">
<?php 
    $awards = GetAllAwards();
    foreach ($awards as $award) {
        echo "<option value=\"{$award['award_id']}\">{$award['name']}</option>";
    }
    ?>
		</select>
		</td></tr>
		<tr><td>Date:</td><td><?php 
    $form->textField('date');
    ?>
</td></tr>
		<tr><td>Details:</td><td><?php 
    $form->textArea('details', 10, 30);
    ?>
</td></tr> 
		<tr><td colspan="2"><?php 
    $form->submitButton('processed', 'Add');
    ?>
</td></tr>
<?php 
    CloseTable();
    $form->__destruct();
}