コード例 #1
0
function enigma($links, $mitte, $rechts, $stator, $str, $s1, $s2, $ring1, $ring2, $ring3, $steckbr, $pukw)
{
    $spw1 = $stator[$s1];
    $spw2 = $stator[$s2];
    $stator_links = $stator;
    $stator_mitte = $stator;
    $stator_rechts = $stator;
    $schalter_1 = $spw1;
    $schalter_2 = $spw2;
    $stator_neu___ = steckbrett($steckbr);
    //-------------------------- Positionen der einzelnen Walzen ------------------------
    for ($i = 1; $i <= $ring1; $i++) {
        $rechts = rot($rechts);
        $stator_rechts = rot($stator_rechts);
    }
    for ($i = 1; $i <= $ring2; $i++) {
        $mitte = rot($mitte);
        $stator_mitte = rot($stator_mitte);
    }
    for ($i = 1; $i <= $ring3; $i++) {
        $links = rot($links);
        $stator_links = rot($stator_links);
    }
    //-------------------------- Positionen der einzelnen Walzen ------------------------
    for ($i = 0; $i < strlen($str); $i++) {
        $zeichen = $str[$i];
        // holt sich einen Buchstaben aus dem String, den er Verschlüsseln wird
        $stator_rechts = rot($stator_rechts);
        // Rotation der rechten Walze, beginnt vor der Verschlüsselung (hier der Stator)
        $rechts = rot($rechts);
        //Rotation der rechten Walze, beginnt vor der Verschlüsselung (hier die Walze)
        $x = get_pos($stator_neu___, $zeichen);
        // holt sich die Position des eingegebenen Buchstaben auf den Stator
        $zeichen = get_zeichen($rechts, $x);
        // holt sich das Zeichen auf der Position die vorher ermittelt wurde("dort wo der Strom reingeht")
        $x = get_pos($stator_rechts, $zeichen);
        //holt sich die Position des zeichens auf dem Walzenstator um die Position zu erfahren wo er in die nächste Walze(mitte) rein muss
        if ($schalter_2 == $stator_mitte[1]) {
            $stator_mitte = rot($stator_mitte);
            $mitte = rot($mitte);
            $stator_links = rot($stator_links);
            $links = rot($links);
        }
        if ($schalter_1 == $stator_rechts[0]) {
            $stator_mitte = rot($stator_mitte);
            $mitte = rot($mitte);
        }
        $zeichen = get_zeichen($mitte, $x);
        // holt sich das Zeichen auf der Walze mitte
        $x = get_pos($stator_mitte, $zeichen);
        // holt sich die Position auf dem Stator der Walze mitte
        $zeichen = get_zeichen($links, $x);
        // holt sich das Zeichen auf der Walze links
        $x = get_pos($stator_links, $zeichen);
        // holt sich die Position auf dem Stator der Walze links um die Position zu erfahren wo er in die UKW muss
        $zeichen = get_zeichen($stator, $x);
        //
        if ($pukw == 0) {
            $zeichen = ukw1($zeichen);
        }
        if ($pukw == 1) {
            $zeichen = ukw2($zeichen);
        }
        //------Verlauf nach UKW--------------------
        $x = get_pos($stator, $zeichen);
        $zeichen = get_zeichen($stator_links, $x);
        $x = get_pos($links, $zeichen);
        $zeichen = get_zeichen($stator_mitte, $x);
        $x = get_pos($mitte, $zeichen);
        $zeichen = get_zeichen($stator_rechts, $x);
        $x = get_pos($stator_rechts, $zeichen);
        $zeichen = get_zeichen($stator_rechts, $x);
        $x = get_pos($rechts, $zeichen);
        $zeichen = get_zeichen($stator_neu___, $x);
        $string .= $zeichen;
    }
    return $string;
}
コード例 #2
0
ファイル: personnel.php プロジェクト: haogm123/ydoa
                ?>
</TD>
								<TD WIDTH=100><?php 
                echo $rowper['approvaldate'];
                ?>
</TD>
							</TR>
				<?php 
            }
        }
    }
} else {
    global $db;
    $query = $db->query("SELECT * FROM " . DB_TABLEPRE . "personnel WHERE fileid = '" . $_GET['fileid'] . "' and type=2 and pkey!=0  and node=2 order by id desc");
    while ($rowper = $db->fetch_array($query)) {
        if ($rowper['lnstructions'] != '' and get_pos(get_userid($rowper['name'])) > 1) {
            if ($rowper['appkey'] == 1) {
                app_view_per($rowper['id']);
            } else {
                ?>
		   <TR HEIGHT=25>
				<TD><?php 
                echo $rowper['lnstructions'];
                ?>
</TD>
				<TD WIDTH=60><?php 
                echo $rowper['name'];
                ?>
</TD>
				<TD WIDTH=100><?php 
                echo $rowper['approvaldate'];
コード例 #3
0
     echo "<th> Xóa <th>";
 }
 echo "</tr>";
 foreach ($work as $namepos) {
     echo "<tr>";
     echo '<td><a href=?action=show_profile_different&EId=' . $namepos['EId'] . '>' . $namepos['Name'] . '</a></td>';
     echo '<td> ' . $namepos['Position'] . '</td>';
     if ($dep_auth['DId'] == $i['DId'] && $dep_auth['Authority'] >= 2 || $dep_auth['Authority'] >= 4) {
         echo "<td>";
         echo "<form action='index.php' method='post'>";
         echo '<input type="hidden" name="action" value="ChangePos">';
         echo '<input type="hidden" name="Dep" value=' . $i['DId'] . '>';
         echo '<input type="hidden" name="EId" value=' . $namepos['EId'] . '>';
         echo '<select name="Position"';
         echo ">";
         $pos = get_pos();
         foreach ($pos as $j) {
             if ($j['Authority'] <= $dep_auth['Authority'] && $j['Authority'] <= $i['LimitAuth']) {
                 echo '<option value=' . '"' . $j['Id'] . '"';
                 if ($j['Id'] == $namepos['Id']) {
                     echo 'selected=selected';
                 }
                 echo ">";
                 echo $j['Position'] . "</option>";
             }
         }
         echo "</select>";
         echo '<input class="btn btn-primary" type="submit" value="Sửa" id="update">';
         echo "</form>";
         echo "</td>";
         echo "<td>";