Example #1
0
if ($_GET['id'] == 1) {
    echo "<p style=\"background:#9ACD32;margin-left:300px; width:400px;padding:10px 20px; border-radius:2px; color:white;\">Question added Successfully</p>";
} else {
    if ($_GET['id'] == 2) {
        echo "<p style=\"background:#9ACD32;margin-left:300px; width:400px;padding:10px 20px; border-radius:2px; color:white;\">Deletion Successfull</p>";
    } else {
        if ($_GET['id'] == 3) {
            echo "<p style=\"background:#9ACD32;margin-left:300px; width:400px;padding:10px 20px; border-radius:2px; color:white;\">Question updated Successfully</p>";
        }
    }
}
?>
        <?php 
echo "<div >\n                    <table class =\"table-style\">\n                    <th>id   </th>\n                    <th> Problem</th>";
$query = "select * from questions";
$result = mysqli_query($con, $query);
while ($row = mysqli_fetch_array($result)) {
    echo '<tr>
                        <td>' . $row['id'] . '</td>
                        <td><a href = ../problem.php?id=' . string_to_url($row['name']) . '>' . $row['name'] . '</a></td>
                        <td style = "width:150px;"><a href = editques.php?id=' . string_to_url($row['name']) . '>edit</a></td>
                        <td style = "width:150px"><a style = "color:red;" href = delete.php?id=' . string_to_url($row['name']) . '>delete</a></td>
                       </tr> ';
}
echo "</table>\n                    </div>";
?>



    </body>
</html>
Example #2
0
                    </ul>
                </div>
            </div>
        </div>
<?php 
echo '<table class = "table-style">
            <th>id</th>
            <th>question</th>
            <th>time</th>
            <th>status</th>
            ';
$query = "SELECT * from code_submissions where username = '******'";
if (mysqli_query($con, $query)) {
    $result = mysqli_query($con, $query);
} else {
    echo "fas" . mysqli_error($con);
}
while ($row = mysqli_fetch_array($result)) {
    //messed up commas but working :P
    $color = "#d4edc9";
    if (!$row['status']) {
        $color = "#f9e3e3";
    }
    echo '<tr >
                <td style = "background:' . $color . '"><a href = "codedisplay.php?id=' . $row['code_num'] . '" target = "_blank">' . $row['code_num'] . '</a></td>
                <td style = "background:' . $color . '"><a href = "problem.php?id=' . string_to_url($row['question']) . '">' . $row['question'] . '</a></td>
                <td style = "background:' . $color . '">' . $row['sub_time'] . '</td>
                <td style = "background:' . $color . '">' . $row['result'] . '</td>
              </tr>';
}
echo '</table>';
Example #3
0
          {
              if(!strcmp($content[$j],' '))
                  echo "here&nbsp";
              else
                $enter = 0;
          }
          else
              echo $content[$j];
          $j++;
      }*/
?>
        </textarea>
        </div>
        <div  style = "float:right ;width:50%">
        <form action = "code-result.php?id=<?php 
echo string_to_url($problem_name);
?>
" method = "post" id = "main-form">
            <label>Language</label><select name = "lang">
                                        <option value = "C">C</option>
                                        <option value = "C++">C++</option>
                                    </select><br>
           <textarea id = "area" name = "code-area" rows = "30" cols = "80">
/*enter your code here*/

#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    int n;
Example #4
0
            <div id = "logo">
                D-odge  ^
            </div>
            <div id = "header-bar">
                <div id = "menu" style ="float:left">
                    <ul>
                       <li><a href = "problemset.php">Problemset</a></li>
                   </ul>
                </div>
                <div id = user-id style = "float:right; font-size:19px;">
                    <ul>
                        <li ><a href = "userhome.php"><?php 
echo $_SESSION['username'];
?>
</a></li>
                        <li><a href = "logout.php">Logout</a></li>
                    </ul>
                </div>
            </div>
        </div>
<?php 
echo "<div style = \"margin:20px 30px\">\n            <table class =\"table-style\">\n            <th>id   </th>\n            <th> Problem</th>";
$query = "select * from questions";
$result = mysqli_query($con, $query);
while ($row = mysqli_fetch_array($result)) {
    echo '<tr>
                <td>' . $row['id'] . '</td>
                <td><a href = problem.php?id=' . string_to_url($row['name']) . '>' . $row['name'] . '</a></td>
               </tr> ';
}
echo "</table>\n            </div>";