コード例 #1
0
ファイル: admin.php プロジェクト: skyser2003/Hall-of-Fame
     }
     print '<form action="?" method="post">';
     print '<textarea name="fileData" style="width:800px;height:300px;">';
     print file_get_contents($file);
     print "</textarea><br>\n";
     print '<input type="submit" name="changeData" value="修正">';
     print '<input type="submit" value="更新">';
     print '<input type="hidden" name="adminUpDate" value="1">';
     print "</form>\n";
 } else {
     if ($_POST["adminAutoControl"]) {
         $file = MANAGE_LOG_FILE;
         print "<p>自動管理のログ</p>\n";
         // データの修正
         if ($_POST["changeData"]) {
             changeData($file, $_POST["fileData"]);
         }
         print '<form action="?" method="post">';
         print '<textarea name="fileData" style="width:800px;height:300px;">';
         print file_get_contents($file);
         print "</textarea><br>\n";
         print '<input type="submit" name="changeData" value="修正">';
         print '<input type="submit" value="更新">';
         print '<input type="hidden" name="adminAutoControl" value="1">';
         print "</form>\n";
     } else {
         if ($_GET["menu"] === "other") {
             print "\n<p>そのた</p>\n\n<ul>\n\n<li><a href=\"" . ADMIN_DIR . "list_item.php\">アイテム一覧</a></li>\n\n<li><a href=\"" . ADMIN_DIR . "list_enchant.php\">装備効果一覧</a></li>\n\n<li><a href=\"" . ADMIN_DIR . "list_job.php\">職業一覧</a></li>\n\n<li><a href=\"" . ADMIN_DIR . "list_judge.php\">判定一覧</a></li>\n\n<li><a href=\"" . ADMIN_DIR . "list_monster.php\">モンスター一覧</a></li>\n\n<li><a href=\"" . ADMIN_DIR . "list_skill3.php\">スキル一覧</a></li>\n\n<li><a href=\"" . ADMIN_DIR . "set_action2.php\">パターン設定機</a></li>\n\n</ul>\n\n";
         } else {
             print "\n<p>基本設定</p>\n\n<table border=\"1\">\n\n<tr><td>定義</td><td>説明</td><td>値</td></tr>\n<tr><td>TITLE</td><td>タイトル</td><td>" . TITLE . "</td></tr>\n\n<tr><td>MAX_TIME</td><td>最大Time</td><td>" . MAX_TIME . "Time</td></tr>\n\n<tr><td>TIME_GAIN_DAY</td><td>1日で増えるTime</td><td>" . TIME_GAIN_DAY . "Time</td></tr>\n\n<tr><td>CONTROL_PERIOD</td><td>自動管理周期</td><td>" . CONTROL_PERIOD . "s(" . CONTROL_PERIOD / 60 / 60 . "hour)" . "</td></tr>\n\n<tr><td>RECORD_IP</td><td>IPを記録するか(1=ON)</td><td>" . RECORD_IP . "</td></tr>\n\n<tr><td>SELLING_PRICE</td><td>売値</td><td>" . SELLING_PRICE . "</td></tr>\n\n<tr><td>EXP_RATE</td><td>経験値倍率</td><td>x" . EXP_RATE . "</td></tr>\n\n<tr><td>MONEY_RATE</td><td>お金倍率</td><td>x" . MONEY_RATE . "</td></tr>\n\n<tr><td>AUCTION_MAX</td><td>最大出品数</td><td>" . AUCTION_MAX . "</td></tr>\n\n<tr><td>JUDGE_LIST_AUTO_LOAD</td><td>条件判定のリストを自動取得(1=自動)</td><td>" . JUDGE_LIST_AUTO_LOAD . "</td></tr>\n\n<tr><td>AUCTION_TOGGLE</td><td>オークションON/OFF(1=ON)</td><td>" . AUCTION_TOGGLE . "</td></tr>\n\n<tr><td>AUCTION_EXHIBIT_TOGGLE</td><td>出品ON/OFF(1=ON)</td><td>" . AUCTION_EXHIBIT_TOGGLE . "</td></tr>\n\n<tr><td>RANK_TEAM_SET_TIME</td><td>ランキングのチーム設定周期</td><td>" . RANK_TEAM_SET_TIME . "s(" . RANK_TEAM_SET_TIME / 60 / 60 . "hour)" . "</td></tr>\n\n<tr><td>RANK_BATTLE_NEXT_LOSE</td><td>負けたときの待ち時間</td><td>" . RANK_BATTLE_NEXT_LOSE . "s(" . RANK_BATTLE_NEXT_LOSE / 60 / 60 . "hour)" . "</td></tr>\n\n<tr><td>RANK_BATTLE_NEXT_WIN</td><td>勝利した場合の待ち時間</td><td>" . RANK_BATTLE_NEXT_WIN . "s</td></tr>\n\n<tr><td>NORMAL_BATTLE_TIME</td><td>モンスターとの戦いで消費する時間</td><td>" . NORMAL_BATTLE_TIME . "Time</td></tr>\n\n<tr><td>MAX_BATTLE_LOG</td><td>戦闘ログ保存数(通常モンスター)</td><td>" . MAX_BATTLE_LOG . "</td></tr>\n\n<tr><td>MAX_BATTLE_LOG_UNION</td><td>戦闘ログ保存数(ユニオン)</td><td>" . MAX_BATTLE_LOG_UNION . "</td></tr>\n\n<tr><td>MAX_BATTLE_LOG_RANK</td><td>戦闘ログ保存数(ランキング)</td><td>" . MAX_BATTLE_LOG_RANK . "</td></tr>\n\n<tr><td>UNION_BATTLE_TIME</td><td>ユニオン戦で消費する時間</td><td>" . UNION_BATTLE_TIME . "Time</td></tr>\n\n<tr><td>UNION_BATTLE_NEXT</td><td>ユニオン戦の待ち時間</td><td>" . UNION_BATTLE_NEXT . "s</td></tr>\n\n<tr><td>BBS_BOTTOM_TOGGLE</td><td>下部メニューにある一行掲示板(1=ON)</td><td>" . BBS_BOTTOM_TOGGLE . "</td></tr>\n\n</table>\n\n";
         }
コード例 #2
0
    echo 'Average units sold per employee is ' . $stuff / count($contentsArray) . PHP_EOL;
    arsort($contentsArray);
    // var_dump($contentsArray);
    print_r($contentsArray);
    // $unitss=0;
    // foreach($contentsArray as $index => $value){
    // 	$units=$units +$value[]
    // }
    // contentsArray['Columns'] = Units'.'|'.'Full Name'. '|'.'Employee Number';
    // contentsArray['Units'] =
    echo "====================================================================" . PHP_EOL;
    echo "Units     |Full Name                               |Employee Number" . PHP_EOL;
    echo "====================================================================" . PHP_EOL;
    foreach ($contentsArray as $item) {
        echo spacing(10, $item['Units']) . '|' . spacing(40, $item['Full Name']) . '|' . spacing(10, $item['Employee Number']) . PHP_EOL;
    }
}
function spacing($totalCharacters, $stringValue)
{
    $lengthOfString = strlen($stringValue);
    $numberOfSpaces = $totalCharacters - $lengthOfString;
    $stringValueWithSpaces = $stringValue;
    for ($i = 0; $i < $numberOfSpaces; $i++) {
        $stringValueWithSpaces .= " ";
    }
    return $stringValueWithSpaces;
}
//printf function does spacing/formatting quicker than this.
//jonathan used usort function.
changeData('employeeInfo.txt');
コード例 #3
0
ファイル: index.php プロジェクト: husnulka/firstRepo
 case 'ed':
     $valHdnFrm = '<input type="hidden" name="act" value="' . base64_encode('1') . '">';
     $reqId = isset($_REQUEST['id']) ? base64_decode(trim($_REQUEST['id'])) : "";
     $aDtId = getData($DBLink, $tbl, "*", "CSC_DC_ID='" . $reqId . "'", $ord = "");
     if (isset($aDtId) && !empty($aDtId)) {
         foreach ($aDtId as $dtId) {
             $recId = $dtId['CSC_DC_ID'];
             $recNm = $dtId['CSC_DC_NAME'];
             $recPrnt = $dtId['CSC_DC_PARENT'];
         }
     }
     $chP = $recId == $recPrnt ? 'checked' : '';
     $chC = $recId != $recPrnt ? 'checked' : '';
     if (isset($_POST['act']) && base64_decode(trim($_POST['act'])) == '1') {
         $val = 'CSC_DC_ID="' . $psId . '", CSC_DC_NAME="' . $psNm . '", CSC_DC_PARENT="' . $psPrnt . '"';
         $bOk = changeData($DBLink, $tbl, $val, $crt = 'CSC_DC_ID="' . $reqId . '"');
         if ($bOk) {
             echo '<script>' . 'alert("Berhasil mengubah data ' . $reqId . '.");' . 'location.href="index.php";' . '</script>';
         } else {
             echo '<script>' . 'alert("GAGAL mengubah  data ' . $reqId . '.");' . 'location.href="index.php";' . '</script>';
         }
     }
     break;
 case 'dl':
     $reqId = isset($_REQUEST['id']) ? base64_decode(trim($_REQUEST['id'])) : "";
     $bOk = deleteData($DBLink, $tbl, $crt = 'CSC_DC_ID="' . $reqId . '"');
     if ($bOk) {
         echo '<script>' . 'alert("Berhasil menghapus data ' . $reqId . '.");' . 'location.href="index.php";' . '</script>';
     } else {
         echo '<script>' . 'alert("GAGAL menghapus  data ' . $reqId . '.");' . 'location.href="index.php";' . '</script>';
     }