コード例 #1
0
ファイル: search.php プロジェクト: studur/elabchem
            <a href='make_csv.php?id=<?php 
                echo $results_id_str;
                ?>
&type=items'><img src='img/spreadsheet.png' title='Export in spreadsheet file' alt='Export in spreadsheet file' /></a>
            </div>
<?php 
                if ($count == 1) {
                    echo "<div id='search_count'>" . $count . " result</div>";
                } else {
                    echo "<div id='search_count'>" . $count . " results</div>";
                }
                echo "<div class='search_results_div'>";
                // Display results
                echo "<hr>";
                foreach ($results_id as $id) {
                    showDB($id, $_SESSION['prefs']['display']);
                }
            } else {
                // no results
                $message = "Sorry, I couldn't find anything :(";
                echo display_message('error', $message);
            }
        }
    }
}
?>

<script>
$(document).ready(function(){
    // DATEPICKER
    $( ".datepicker" ).datepicker({dateFormat: 'yy-mm-dd'});
コード例 #2
0
ファイル: showDB.php プロジェクト: studur/elabchem
    $sql = "SELECT * FROM items ORDER BY id DESC LIMIT 10";
    $req = $bdd->prepare($sql);
    $req->execute();
    $count = $req->rowCount();
    if ($count == 0) {
        $message = "<strong>Welcome to eLabFTW.</strong> \n            Select an item in the «Create new» list to begin filling your database.";
        echo display_message('info', $message);
    } else {
        $results_arr = array();
        while ($final_query = $req->fetch()) {
            $results_arr[] = $final_query['id'];
        }
        // loop the results array and display results
        echo "<p>Showing last 10 uploads :</p>";
        foreach ($results_arr as $result_id) {
            showDB($result_id, $display);
        }
    }
}
?>

<script>
function go_url(x) {
    if(x == '') {
        return;
    }
    location = x;
}
</script>

コード例 #3
0
ファイル: adminSQL.php プロジェクト: TeamMagneto/CS321
function deleteEverything()
{
    $con = connect();
    $sql = "DELETE FROM Hotel";
    if (mysqli_query($con, $sql)) {
        echo " Deleted Everything in Hotel";
    } else {
        echo " Failed to Delete Everything in Hotel";
    }
    showDB($con);
    echo "All data deleted. Please insert some data";
}
コード例 #4
0
ファイル: showDB.php プロジェクト: boots7458/elabftw
} elseif (count($results_arr) === 0 && $search_type === 'none') {
    display_message('info', _('<strong>Welcome to eLabFTW.</strong> Select an item in the «Create new» list to begin filling your database.'));
} else {
    ?>
    <div class='align_right'>
        <a name='anchor'></a>
        <p class='inline'><?php 
    echo _('Export this result:');
    ?>
 </p>
        <a href='make.php?what=zip&id=<?php 
    echo Tools::buildStringFromArray($results_arr);
    ?>
&type=items'>
            <img src='img/zip.png' title='make a zip archive' alt='zip' />
        </a>

        <a href='make.php?what=csv&id=<?php 
    echo Tools::buildStringFromArray($results_arr);
    ?>
&type=items'>
            <img src='img/spreadsheet.png' title='Export in spreadsheet file' alt='Export CSV' />
        </a>
    </div>
    <?php 
    echo "<p class='smallgray'>" . count($results_arr) . " " . ngettext("result found", "results found", count($results_arr)) . " (" . $total_time['time'] . " " . $total_time['unit'] . ")</p>";
}
// loop the results array and display results
foreach ($results_arr as $result_id) {
    showDB($result_id, $_SESSION['prefs']['display']);
}