コード例 #1
0
ファイル: index.php プロジェクト: jhunkeler/bayonetcms
  	<fieldset>
  	<legend>Administration Menu:</legend>
      <?php 
        $th = array('Administration Menu', '');
        $td = array(LinkInternal('<img src="images/modules.png" /><br />Modules', '?op=modules'), LinkInternal('<img src="images/blocks.png" /><br />Blocks', '?op=blocks'), LinkInternal('<img src="images/navigation.png" /><br />Navigation', '?op=navigation'), LinkInternal('<img src="images/users_two.png" /><br />Edit Admins', '?op=admins'), LinkInternal('<img src="images/announcement.png" /><br />Announcements', '?op=announcements'));
        //render administration table
        CompileAdmin($th, $td);
        ?>
 	</fieldset>
<br />
  	<fieldset>
  	<legend>Module Administration:</legend>
      <?php 
        $th = array('Module Administration', '');
        $td = array(LinkInternal('<img src="images/editpage.png" /><br />Pages', '?op=pages'), LinkInternal('<img src="images/image.png" /><br />News Reel', '?op=newsreel'), LinkInternal('<img src="images/news.png" /><br />News', '?op=news'), LinkInternal('<img src="images/calendar.png" /><br />Calendar', '?op=calendar'), LinkInternal('<img src="images/box_download.png" /><br />Downloads', '?op=downloads'), LinkInternal('<img src="images/rudi.png" /><br />RUDI', '?op=rudi'), LinkInternal('<img src="images/adjutant.png" /><br />Adjutant', '?op=adjutant'));
        //render administration table
        CompileAdmin($th, $td);
        ?>
 	</fieldset>

<br />
<a name="operation"></a>
<div style="text-align:center"><?php 
        include 'operation.php';
        ?>
</div>

  </div>
<?php 
        $phpversion = preg_replace('/[a-z-]/', '', phpversion());
コード例 #2
0
ファイル: index.php プロジェクト: jhunkeler/bayonetcms
 <?php 
/**
 * This file administers the site blocks.
 * 
 * -weight
 * -directory name
 */
if (!defined("ADMIN_FILE")) {
    die("Access denied.");
}
include $basedir . 'blocks/functions.php';
if (isset($_GET['edit'])) {
    $block_id = $_GET['edit'];
    EditBlock($block_id);
} else {
    if (isset($_GET['delete'])) {
        $block_id = $_GET['delete'];
        DeleteBlock($block_id);
    } else {
        if (isset($_GET['create'])) {
            NewBlock();
        } else {
            echo "<table align=\"center\" width=\"200px\"><tr><th>" . LinkInternal('<img src="images/add.png" />Create a Block', '?op=blocks&create=true') . "</th></tr></table>";
            ListBlocks();
        }
    }
}
?>
 
</center></td></tr>
</table>
コード例 #3
0
<?php

$award = getAward($award_id);
$form = new BayonetForm("", "POST");
if ($form->verifySubmit('processed')) {
    global $db;
    $name = $form->request['name'];
    $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>
コード例 #4
0
ファイル: functions.php プロジェクト: jhunkeler/bayonetcms
function EditPage($page_id)
{
    global $db;
    $page_id = addslashes($page_id);
    // If the user has submitted, then process their request.
    if (isset($_POST['processed'])) {
        //Secure our data to prevent injection attacks.
        $title = addslashes($_POST['title']);
        $text = addslashes($_POST['text']);
        if (empty($title)) {
            echo "You must fill everything out before proceeding.";
            return;
        }
        //Update the database with the new data.
        $db->Query("UPDATE `bayonet_pages` SET `title` = '{$title}', `text` = '{$text}' WHERE `page_id` = '{$page_id}'");
        echo "Page, '{$title}', has been edited.\n";
        PageRedirect(2, "?op=pages&edit={$page_id}");
        //die, because we have completed what we wanted to do.
        return;
    }
    //Grab the page from the database according to the $article_id passed to the function.
    $result = $db->Query("SELECT `title`, `text` FROM `bayonet_pages` WHERE `page_id` = '{$page_id}' LIMIT 1");
    $page = $db->FetchRow($result);
    ?>
  	<form action="<?php 
    $_SERVER['PHP_SELF'];
    ?>
" method="post">
  	<table>
  		<tr>
		  <td colspan="2">
		  	<input type="submit" name="processed" value="Submit Changes" />
			<?php 
    echo LinkInternal('<img src="images/view.png" />&nbsp;View this Page', '../index.php?load=page&id=' . $page_id . '" target=\\"blank');
    ?>
			<?php 
    echo LinkInternal("<img src=\"images/cancel.png\" /> Delete This Page", "?op=pages&delete={$page_id}");
    ?>
		  </td>
	    </tr>
  		<tr>
		  <th>Title:</th>
		  <td><input type="text" name="title" value="<?php 
    echo $page['title'];
    ?>
" maxlength="50" size="30" /></td>
	    </tr>		  		
  		<tr>
	      <th>Text:</th>
		  <td><textarea id="markItUp" rows="30" cols="80" name="text"><?php 
    echo $page['text'];
    ?>
</textarea></td>
	    </tr>
	</table>
  	</form>
  <?php 
}
コード例 #5
0
ファイル: functions.php プロジェクト: jhunkeler/bayonetcms
function EditBlock($block_id)
{
    global $db;
    if (isset($_POST['processed'])) {
        //Secure our data to prevent injection attacks.
        $weight = (int) addslashes($_POST['weight']);
        $dir_name = addslashes($_POST['dir_name']);
        $position = (int) addslashes($_POST['position']);
        $active = addslashes($_POST['active']);
        $title = addslashes($_POST['title']);
        if (!is_int($weight) || empty($dir_name) || empty($title) || !is_int($position)) {
            echo "You must fill everything out before proceeding.";
            return;
        }
        //Update the database with the new data.
        $db->Query("UPDATE bayonet_blocks SET title = '{$title}', weight = '{$weight}', dir_name = '{$dir_name}', position = '{$position}', active = '{$active}' WHERE block_id = '{$block_id}'");
        //$isActive = $active ? "IS" : "IS NOT";
        echo "Block, '{$dir_name}', at position '{$weight}'(order) has been edited.\n";
        PageRedirect(3, "?op=blocks");
        //die, because we have completed what we wanted to do.
        return;
    }
    //Grab the page from the database according to the $page_id passed to the function.
    $result = $db->Query("SELECT weight,dir_name,position,active,title FROM bayonet_blocks WHERE block_id = '{$block_id}'");
    $block = $db->FetchRow($result);
    ?>
  You are currently editing the '<?php 
    echo $block['title'];
    ?>
' block<br /><br />
  <form action="<?php 
    $_SERVER['PHP_SELF'];
    ?>
" method="post">
  <table align="center">
  <tr><th>Title</th><td><input type="text" name="title" value="<?php 
    echo $block['title'];
    ?>
" /></td></tr>
  <tr><th>Weight</th><td><input type="text" name="weight" value="<?php 
    echo $block['weight'];
    ?>
" /></td></tr>
  <tr><th>Position</th><td><?php 
    GetPosition($block['position']);
    ?>
</td></tr>
  <tr><th>Directory Name</th><td><input type="text" name="dir_name" value="<?php 
    echo $block['dir_name'];
    ?>
" /></td>
  <tr><th>Active</th><td>
    <select name="active">
      <?php 
    GetActive($block_id, $block['active']);
    ?>
  
    </select>
  </td>
  
  <tr><th colspan="2"><input type="submit" name="processed" value="Submit" /><?php 
    echo LinkInternal('<input type="button" value="Cancel" />', "?op=blocks");
    ?>
</th></tr>
  </table>
  </form>
  <?php 
}
コード例 #6
0
ファイル: view.members.php プロジェクト: jhunkeler/bayonetcms
                    $row = $db->Fetch($result);
                    foreach ($row as $member) {
                        echo "<tr>";
                        echo "<td>{$member['shortname']}</td><td class=\"center\">{$member['first_name']} {$member['last_name']}</td>";
                        echo "<td>" . LinkInternal('Edit', '?op=rudi&show=members&profile=' . $member['member_id']) . "</td>";
                        echo "<td>" . LinkInternal('Edit', '?op=rudi&show=members&service=' . $member['member_id']) . "</td>";
                        echo "<td>" . LinkInternal('Edit', '?op=rudi&show=members&award=' . $member['member_id']) . "</td>";
                        echo "<tr>";
                    }
                    CloseTable();
                    ?>
			 <h3>Previous Members</h3>
			 <table width="100%" style="text-align:center;">
			 <tr><th>Rank</th><th>Soldier</th><th>Main Info</th><th>Service Record</th><th>Medal Record</th></tr>
<?php 
                    $result = $db->Query("SELECT * FROM `rudi_unit_members` JOIN `rudi_ranks` ON rudi_unit_members.rank_id=rudi_ranks.rank_id WHERE rudi_unit_members.status_id > 3 ORDER BY rudi_ranks.weight DESC, rudi_unit_members.date_promotion ASC, rudi_unit_members.date_enlisted ASC");
                    $row = $db->Fetch($result);
                    foreach ($row as $member) {
                        echo "<tr>";
                        echo "<td>{$member['shortname']}</td><td class=\"center\">{$member['first_name']} {$member['last_name']}</td>";
                        echo "<td>" . LinkInternal('Edit', '?op=rudi&show=members&profile=' . $member['member_id']) . "</td>";
                        echo "<td>" . LinkInternal('Edit', '?op=rudi&show=members&service=' . $member['member_id']) . "</td>";
                        echo "<td>" . LinkInternal('Edit', '?op=rudi&show=members&award=' . $member['member_id']) . "</td>";
                        echo "<tr>";
                    }
                    CloseTable();
                }
            }
        }
    }
}
コード例 #7
0
<?php

global $db;
$result = $db->Query("SELECT `first_name`, `last_name` FROM `rudi_unit_members` WHERE `member_id` = '{$member_id}' LIMIT 1");
$member = $db->FetchRow($result);
echo "<h3>Service Record of {$member['first_name']} {$member['last_name']}</h3>";
if (isset($_GET['edit'])) {
    $record_id = $_GET['edit'];
    EditServiceRecord($record_id);
} else {
    if (isset($_GET['add'])) {
        if ($_GET['add']) {
            AddServiceRecord($_GET['service']);
        }
    } else {
        echo "<div style=\"text-align:left;\">" . LinkInternal('Back to Roster', '?op=rudi&show=members') . "</div>";
        ListServiceRecord($_GET['service']);
    }
}
コード例 #8
0
ファイル: view.awards.php プロジェクト: jhunkeler/bayonetcms
            include 'view.awards.delete.php';
        } else {
            echo "<h3>Award Classes</h3>";
            $classes = getAwardClasses();
            OpenTable();
            echo "<tr style=\"text-align:center\">";
            foreach ($classes as $class) {
                echo "<td>" . LinkInternal($class['name'], '?op=rudi&show=awards&cid=' . $class['class_id']) . "</td>";
            }
            echo "</tr>";
            CloseTable();
            if (isset($_GET['cid'])) {
                $class_id = $_GET['cid'];
                $awards = getAwardsByClass($class_id);
                echo "<h3>Awards</h3>";
                echo LinkInternal('<img src="images/add.png" />&nbsp;Add New Award', '?op=rudi&show=awards&cid=' . $class_id . '&add=true');
                OpenTable();
                foreach ($awards as $award) {
                    echo "<tr><td>" . $award['name'] . "</td>\n\t\t\t\t\t\t <td><a href=\"?op=rudi&show=awards&award={$award['award_id']}\">Edit</a></td>\n\t\t\t\t\t\t <td><a href=\"?op=rudi&show=awards&delete={$award['award_id']}\">Delete</a></td></tr>";
                }
                CloseTable();
                //include 'view.members.profile.php';
            } else {
                if (isset($_GET['aid'])) {
                    $award_id = $_GET['aid'];
                    //include 'view.members.service.php';
                }
            }
        }
    }
}
コード例 #9
0
<?php

$class_id = $_GET['cid'];
$form = new BayonetForm("", "POST");
if ($form->verifySubmit('processed')) {
    global $db;
    $name = $form->request['name'];
    $text = $form->request['text'];
    decho("INSERT INTO `rudi_awards` SET `class_id` = '{$class_id}', `name` = '{$name}', `description` = '{$text}'");
    $db->Query("INSERT INTO `rudi_awards` SET `class_id` = '{$class_id}', `name` = '{$name}', `image` = '', `description` = '{$text}'");
    PageRedirect(1, "?op=rudi&show=awards&cid=" . $class_id);
    return;
}
echo LinkInternal("Cancel", "?op=rudi&show=awards&cid=" . $class_id);
OpenTable();
?>

<tr><th>Name:</th><td><?php 
$form->textField('name', "", false, "50");
?>
</td><tr>
<tr><th>Image:</th><td><?php 
?>
</td></tr>
<tr><th>Text:</th><td><?php 
$form->textArea('text', 10, 30);
?>
</td></tr>
<tr><td><?php 
$form->submitButton('processed', 'Add');
?>
コード例 #10
0
ファイル: index.php プロジェクト: jhunkeler/bayonetcms
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * This file administers the site blocks.
 * 
 * -weight
 * -directory name
 */
if (!defined("ADMIN_FILE")) {
    die("Access denied.");
}
include $basedir . 'blocks/functions.php';
if (isset($_GET['edit'])) {
    $block_id = $_GET['edit'];
    EditBlock($block_id);
    return;
}
if (isset($_GET['delete'])) {
    $block_id = $_GET['delete'];
    DeleteBlock($block_id);
    return;
}
if (isset($_GET['create'])) {
    NewBlock();
    return;
}
echo "<table align=\"center\" width=\"200px\"><tr><th>" . LinkInternal('Create a Block', '?load=admin&op=blocks&create=true') . "</th></tr></table>";
ListBlocks();
?>
 
コード例 #11
0
ファイル: functions.php プロジェクト: jhunkeler/bayonetcms
function EditPage($page_id)
{
    global $db;
    $page_id = addslashes($page_id);
    // If the user has submitted, then process their request.
    if (isset($_POST['processed'])) {
        //Secure our data to prevent injection attacks.
        $title = addslashes($_POST['title']);
        $text = addslashes($_POST['text']);
        if (empty($title) || empty($text)) {
            echo "You must fill everything out before proceeding.";
            return;
        }
        //Update the database with the new data.
        $db->Query("UPDATE bayonet_pages SET title = '{$title}', text = '{$text}' WHERE page_id = '{$page_id}'");
        echo "Page, '{$title}', has been edited.\n";
        //die, because we have completed what we wanted to do.
        return;
    }
    $aid = $_GET['aid'];
    ?>
  
   <table width="100%">
   		<tr>
   			<td><?php 
    ListPages($page_id);
    ?>
</td>
			<td><?php 
    echo LinkInternal('<img src="images/view.gif" />&nbsp;View this Page', '?load=page&id=' . $page_id);
    ?>
</td>
   			<td class="right"><?php 
    echo LinkInternal('<img src="images/delete.gif" />&nbsp;Delete this Page', '?load=admin&op=pages&delete=' . $page_id);
    ?>
</td>
   		</tr>
   </table>
   <hr />
   <table class="cleartable" width="100%" style="height:95%;" cellspacing="0">
   		<tr>
		   <td style="vertical-align:top;">
   				<?php 
    ListArticles($page_id);
    ?>
			</td>
			<td style="width:589px; vertical-align:top; border-left:1px solid #848484;">
   		<?php 
    //if article is set then EditArticle();
    if ($aid > 0) {
        EditArticle($aid);
    }
    ?>
   			</td>
  		</tr>
  </table>
  <?php 
}
コード例 #12
0
ファイル: view.roster.php プロジェクト: jhunkeler/bayonetcms
<div style="text-align: center">
<?php 
echo LinkInternal('Active Roster', '?load=rudi');
echo '&nbsp;&nbsp;&nbsp;' . LinkInternal('Past Member Roster', '?load=rudi&select=past') . '<br /><br />';
?>
</div>
<center>
<table width="100%" cellspacing="1" cellpadding="0" class="rudiroster">
<?php 
if (isset($_GET['select']) && $_GET['select'] == "past") {
    ?>
		<tr><th colspan="5">Past Members Roster</th></tr>
		<tr>
	      <!-- Table header -->
	      <th class="header" width="90px">Rank</th>
	      <th class="header" width="280px">Name</th>
	      <th class="header" width="174px">Role</th>
	      <th class="header" width="160px">Time in Service</th>
	      <th class="header" width="140px">Status</th>
	    </tr>	    
<?php 
    $this->printPastRoster();
} else {
    $result = $this->db->query("SELECT * FROM `rudi_combat_units` WHERE `detachment` = 0");
    $row = $this->db->fetch($result);
    foreach ($row as $unit) {
        $unit_id = $unit['unit_id'];
        decho("SELECT `member_id` FROM `rudi_unit_members` WHERE `cunit_id` = '{$unit_id}' AND `date_discharged` IS NULL LIMIT 1");
        $num = 0;
        $check = $this->db->Query("SELECT `member_id` FROM `rudi_unit_members` WHERE `cunit_id` = '{$unit_id}' AND `date_discharged` IS NULL LIMIT 1");
        $num = $this->db->Rows($check);
コード例 #13
0
ファイル: index.php プロジェクト: jhunkeler/bayonetcms
 */
?>
 <div style="text-align:left;"><h2>- Edit Admins</h2></div>
<?php 
if (!defined("ADMIN_FILE")) {
    die("Access denied.");
}
include $basedir . 'admins/functions.php';
?>

<table class="panel" width="100%" cellspacing="0">
	<tr>
	<td class="panel-none">
		<table align="center" width="200px">
			<tr><th><?php 
echo LinkInternal('<img src="images/add.png" />Add New Admin', '?op=admins&create=true');
?>
</th></tr>
		</table>
		<?php 
ListAdmins();
?>
	</td>
	<td class="panel-box">
<?php 
if (isset($_GET['edit'])) {
    $user_id = $_GET['edit'];
    EditAdmin($user_id);
} else {
    if (isset($_GET['delete'])) {
        $user_id = $_GET['delete'];
コード例 #14
0
ファイル: index.php プロジェクト: jhunkeler/bayonetcms
if (isset($_GET['delete'])) {
    $page_id = $_GET['delete'];
    DeletePage($page_id);
    return;
}
if (isset($_GET['create'])) {
    $create = $_GET['create'];
    if ($create) {
        NewPage();
        return;
    }
}
?>

  	<table width="100%">
      <tr>
 		<td><?php 
ListPages();
?>
</td>
 		<td class="right">
		 	<?php 
echo LinkInternal('<img src="images/add.gif" />&nbsp;Create a Page', '?load=admin&op=pages&create=true');
?>
	 	</td>

	<tr>
	</table>
	</fieldset>
</div>
コード例 #15
0
ファイル: index.php プロジェクト: jhunkeler/bayonetcms
 <?php 
if (!defined("ADMIN_FILE")) {
    die("Access denied.");
}
if (isset($_GET['show'])) {
    switch ($_GET['show']) {
        case 'members':
            include $basedir . 'rudi/views/view.members.php';
            break;
        case 'units':
            include $basedir . 'rudi/views/view.units.php';
            break;
        case 'awards':
            include $basedir . 'rudi/views/view.awards.php';
            break;
        case 'ranks':
            include $basedir . 'rudi/views/view.ranks.php';
            break;
        case 'drills':
            include $basedir . 'rudi/views/view.drills.php';
            break;
        case 'battles':
            include $basedir . 'rudi/views/view.battles.php';
            break;
    }
} else {
    $th = array('Rudi Options', '');
    $td = array(LinkInternal('Roster', '?op=rudi&show=members'), LinkInternal('Units', '?op=rudi&show=units'), LinkInternal('Awards', '?op=rudi&show=awards'), LinkInternal('Battles', '?op=rudi&show=battles'));
    //render administration table
    CompileAdmin($th, $td);
}
コード例 #16
0
ファイル: index.php プロジェクト: jhunkeler/bayonetcms
<hr />
 <table width="100%" style="text-align:center;">
 	<tr>
 		<td>
 			<?php 
echo LinkInternal('Add Events', '?op=calendar&create=true');
?>
 		</td>
 		<td>
 			<?php 
echo LinkInternal('Edit Events', '?op=calendar&edit=');
?>
 		</td>
 		<td>
 			<?php 
echo LinkInternal('Delete Events', '?op=calendar&delete=');
?>
 		</td>
 	</tr>
 </table> -->
 
 <table class="panel" width="100%">
 	<tr>
 		<td style="width:325px; vertical-align:top; text-align:center;">
		 	<a href="?op=calendar&create=true"><img src="images/add.png" /> Add New Event</a><br /><br />
			 <?php 
PrintCalendar();
?>
			 Click on a day to add/edit/delete events
	 	</td>
 		<td class="panel-box">