Ejemplo n.º 1
0
 public function store(Request $request)
 {
     if ($request->user()->can('create', new TravelOrder())) {
         $validator = $this->validator($request->all());
         if ($validator->fails()) {
             return redirect()->back()->withInput()->withErrors($validator);
         } else {
             $approvals = $request->user()->employee->approval_heirarchy;
             $travel = $request->all();
             if ($request->user()->isFinanceDirector()) {
                 $travel = array_add($travel, 'status', 'approved');
             } else {
                 if ($approvals->approved_by && !$approvals->approved_by->user->isPresident()) {
                     $travel = array_add($travel, 'recommending_approval_id', $approvals->approved_by->id);
                 } else {
                     $travel = array_add($travel, 'status', 'recommended');
                 }
                 $travel = array_add($travel, 'finance_director_id', getFinanceDirector()->id);
             }
             $travel = array_add($travel, 'approved_by_id', getPresident()->id);
             $travel = auth()->user()->employee->travel_orders()->save(new TravelOrder($travel));
             write_form(new WriteTravelOrderForm($travel));
             flash()->success('Travel order sent. Please wait for your approvals.');
             return redirect()->to('/travel');
         }
     }
     abort(401);
 }
Ejemplo n.º 2
0
<?php

$player->get_relations();
include get_file_loc('race_voting.php');
include get_file_loc("council.inc");
include get_file_loc('menue.inc');
print_topic("RULING COUNCIL OF {$player->race_name}");
$president = getPresident($player->race_id);
print_council_menue($player->race_id, $president);
// determine for what we voted
$db->query("SELECT * FROM player_votes_relation " . "WHERE account_id = {$player->account_id} AND " . "game_id = {$player->game_id}");
if ($db->next_record()) {
    $voted_for_race = $db->f("race_id_2");
    $voted_for = $db->f("action");
}
print "<table border=\"0\" class=\"standard\" cellspacing=\"0\" align=\"center\" width=\"75%\">";
print "<tr>";
print "<th>Race</th>";
print "<th>Vote</th>";
print "<th>Our Relation<br>with them</th>";
print "<th>Their Relation<br>with us</th>";
print "</tr>";
$db->query("SELECT * FROM race " . "WHERE race_id != {$player->race_id} AND " . "race_id > 1");
while ($db->next_record()) {
    $race_id = $db->f("race_id");
    $race_name = $db->f("race_name");
    print "<tr>";
    print "<td align=\"center\">" . $player->get_colored_race($race_id) . "</td>";
    $container = array();
    $container["url"] = "council_vote_processing.php";
    $container["race_id"] = $race_id;
Ejemplo n.º 3
0
<?php

include get_file_loc("council.inc");
include get_file_loc('menue.inc');
print_topic("RULING COUNCIL OF {$player->race_name}");
print_council_menue($player->race_id, getPresident($player->race_id));
print "<table border=\"0\" class=\"standard\" cellspacing=\"0\" align=\"center\" width=\"50%\">";
print "<tr>";
print "<th>Race</th>";
print "<th>Treaty</th>";
print "</tr>";
$db2 = new SmrMySqlDatabase();
$db->query("SELECT * FROM race " . "WHERE race_id != {$player->race_id} AND " . "race_id > 1");
while ($db->next_record()) {
    $race_id = $db->f("race_id");
    $race_name = $db->f("race_name");
    $db2->query("SELECT * FROM race_has_voting " . "WHERE game_id = {$player->game_id} AND " . "race_id_1 = {$player->race_id} AND " . "race_id_2 = {$race_id}");
    if ($db2->nf() > 0) {
        continue;
    }
    print "<tr>";
    print "<td align=\"center\">" . $player->get_colored_race($race_id) . "</td>";
    $container = array();
    $container["url"] = "council_embassy_processing.php";
    $container["race_id"] = $race_id;
    print_form($container);
    print "<td align=\"center\">";
    print_submit("Peace");
    print "&nbsp;";
    print_submit("War");
    print "</td>";
Ejemplo n.º 4
0
<?php

include get_file_loc("council.inc");
include get_file_loc('menue.inc');
$race_id = $var["race_id"];
if (empty($race_id)) {
    $race_id = $player->race_id;
}
$db->query("SELECT * FROM race " . "WHERE race_id = {$race_id}");
if ($db->next_record()) {
    print_topic("RULING COUNCIL OF " . $db->f("race_name"));
}
$president = getPresident($race_id);
print_council_menue($race_id, $president);
// check for relations here
modifyRelations($race_id);
checkPacts($race_id);
print "<div align=\"center\" style=\"font-weight:bold;\">President</div>";
if ($president->account_id > 0) {
    print "<p><table border=\"0\" class=\"standard\" cellspacing=\"0\" align=\"center\" width=\"75%\">";
    print "<tr>";
    print "<th>Name</th>";
    print "<th>Race</th>";
    print "<th>Alliance</th>";
    print "<th>Experience</th>";
    print "</tr>";
    print "<tr>";
    print "<td valign=\"top\">President ";
    $container = array();
    $container["url"] = "skeleton.php";
    $container["body"] = "trader_search_result.php";