PlacementExperience
edit_exp.php
Go to the documentation of this file.
1 <?php include('experience.php'); ?>
2 
3 <?php
4 include('server.php');
12 if(!$_SESSION['loggedin']) {
13  header("location: index.php");
14 }
15 
16 if(isset($_GET['id'])) {
17  $id = $_GET['id'];
18  $_SESSION['posts_id'] = $id;
19  $sql = "SELECT * FROM posts WHERE id = $id";
20 
21  $result = mysqli_query($db, $sql);
22 
23  $row = mysqli_fetch_assoc($result);
24 
25  $round = explode(",", $row['roundprovided']);
26  $roundcleared = explode(",", $row['roundcleared']);
27  $row['story'] = str_replace("<br/>", "\n", $row['story']);
28 }
29 
30 
31 
32 
33 ?>
34 <html lang="en">
35  <head>
36  <title>Placement Experience | Share</title>
37  <!-- Bootstrap -->
38  <meta charset="utf-8">
39  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
40  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
41  <!--user icon -->
42  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
43 
44  <!-- Google Font -->
45  <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap" rel="stylesheet">
46  <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@800&family=Roboto+Mono&display=swap" rel="stylesheet">
47  <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap" rel="stylesheet">
48  <link rel="stylesheet" type="text/css" href="css/style.css">
49  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
50 
51  </head>
52 <body>
53  <div class="row">
54 
55  <div class="col-sm-3" style="left:0px;">
56  <div class="container-fluid sidenav">
57  <a href="mainpage.php"><img src="img/logoo.png" style="width:100px; margin-top:15px;"></a>
58  <br><br>
59 
60  <div id="cse">
61  <a style="text-decoration: none;" href="https://www.cse.iitb.ac.in" target="_blank">
62  <h6 style="text-align: center;">Department of</h6>
63  <h6 style="text-align: center;">Computer Science and Engineering</h6>
64  <h5 style="text-align: center;">IIT Bombay</h5>
65  </a>
66  </div>
67  <br><br>
68  <ul>
69  <li><a href="mainpage.php"> HOME </a></li>
70  <li><a href="posts.php"> POSTS </a></li>
71  <li><a href="exp_form.php">SHARE</a></li>
72  <li><a href="profile.php"> PROFILE </a></li>
73  </ul>
74  <br><br>
75  <div id="iLinks">
76  <h5>Important Links</h5>
77  <ul>
78  <li style="font-size:10px;"><a href="http://www.iitb.ac.in/" target=_blank> IITB Home</a></li>
79  <li style="font-size:10px;"><a href="https://www.cse.iitb.ac.in/"> CSE@IITB </a></li>
80  <li style="font-size:10px;"><a href="https://asc.iitb.ac.in/"> ASC </a></li>
81  </ul>
82  </div>
83  <br><br>
84  </div>
85  </div>
86 
87  <div class="container-fluid col-md-8 whole" style="margin-top:0px;">
88 
89  <div class="row">
90  <div class="col-sm-8 main" id="title">
91  <img src="img/heading_trans.png" alt="placementExperience" style="align-content: center; margin-left: 25%; margin-right: 25%;">
92  </div>
93  <div class="col-sm-4" style="left:0px; padding-top:20px; vertical-align: center;">
94  <button id="logout" type="button" class="btn btn-info btn-round" style="float:right;">
95  Logout
96  </button>
97  <a href="profile.php"><i class="fa fa-user-circle-o" style="font-size:36px; float:right; padding-right:10px;" ></i></a>
98  </div>
99  </div>
100 
101  <hr class="lineform">
102 
103  <div class="container pt-5">
104 
105  <h2 style="text-align: center;"><b>Experience Form</b></h2>
106  <br>
107  <div class="bg-white p-5 mb-5">
108  <form action="edit_exp_db.php?posts_id=<?= $id; ?>" method="post">
109  <div class="form-group">
110  <label for="name">Name:</label>
111  <input type="hidden" name="id" value="<?= ($row['id']) ?: $row['id'] ?>">
112  <input type="hidden" name="student_id" value="<?= ($row['student_id']) ?: $row['student_id'] ?>">
113  <input type="text" class="form-control" placeholder="Enter full name" id="name" name="name" required value="<?= ($row['name']) ?: $row['name'] ?>" readonly>
114  </div>
115  <div class="form-group">
116  <label for="roll">Roll No:</label>
117  <input type="text" class="form-control" placeholder="Enter CSE Roll number" id="roll" name="roll" required value="<?= ($row['roll']) ?: $row['roll'] ?>" readonly>
118  </div>
119  <div class="form-group">
120  <label for="email">Email address:</label>
121  <input type="email" class="form-control" placeholder="Enter email" id="email" name="email" required value="<?= ($row['email']) ?: $row['email'] ?>" readonly>
122  </div>
123  <div class="form-group">
124  <label for="course">Courses Taken (all semesters):</label>
125  <input type="text" class="form-control" placeholder="Enter comma separated course codes ( eg: CS601,CS725 )" id="course" name="coursetaken" required value="<?= ($row['coursetaken']) ?: $row['coursetaken'] ?>">
126  </div>
127  <div class="form-group">
128  <label for="company">Company Name:</label>
129  <input type="text" class="form-control" placeholder="Enter company's official name" id="company" name="companyname" required value="<?= ($row['companyname']) ?: $row['companyname'] ?>">
130  </div>
131  <br>
132  <h5>Rounds provided by company:</h5>
133 
134  <div class="custom-control custom-checkbox mb-3">
135  <input type="checkbox" <?php if(in_array('Written/Aptitude Round', $round)) { echo "checked"; } ?> class="custom-control-input" value="Written/Aptitude Round" id="written" name="roundprovided[]">
136  <label class="custom-control-label" for="written">Written/Aptitude Round</label>
137  </div>
138  <div class="custom-control custom-checkbox mb-3">
139  <input type="checkbox" class="custom-control-input" <?php if(in_array('Coding Round', $round)) { echo "checked"; } ?> id="coding" name="roundprovided[]" value="Coding Round">
140  <label class="custom-control-label" for="coding">Coding Round</label>
141  </div>
142  <div class="custom-control custom-checkbox mb-3">
143  <input type="checkbox" class="custom-control-input" <?php if(in_array('Group Discussion', $round)) { echo "checked"; } ?> id="gd" name="roundprovided[]" value="Group Discussion">
144  <label class="custom-control-label" for="gd">Group Discussion</label>
145  </div>
146  <div class="custom-control custom-checkbox mb-3">
147  <input type="checkbox" class="custom-control-input" <?php if(in_array('1st Interview Round', $round)) { echo "checked"; } ?> id="int1" name="roundprovided[]" value="1st Interview Round">
148  <label class="custom-control-label" for="int1">1st Interview Round</label>
149  </div>
150  <div class="custom-control custom-checkbox mb-3">
151  <input type="checkbox" class="custom-control-input" <?php if(in_array('2nd Interview (HR) Round', $round)) { echo "checked"; } ?> id="int2" name="roundprovided[]" value="2nd Interview (HR) Round">
152  <label class="custom-control-label" for="int2">2nd Interview (HR) Round</label>
153  </div>
154  <br>
155  <h5>Rounds you have cleared:</h5>
156  <div class="custom-control custom-checkbox mb-3">
157  <input type="checkbox" class="custom-control-input" <?php if(in_array('Written/Aptitude Round', $roundcleared)) { echo "checked"; } ?> id="written2" name="roundcleared[]" value="Written/Aptitude Round">
158  <label class="custom-control-label" for="written2">Written/Aptitude Round</label>
159  </div>
160  <div class="custom-control custom-checkbox mb-3">
161  <input type="checkbox" class="custom-control-input" <?php if(in_array('Coding Round', $roundcleared)) { echo "checked"; } ?> id="coding2" name="roundcleared[]" value="Coding Round">
162  <label class="custom-control-label" for="coding2">Coding Round</label>
163  </div>
164  <div class="custom-control custom-checkbox mb-3">
165  <input type="checkbox" class="custom-control-input" <?php if(in_array('Group Discussion', $roundcleared)) { echo "checked"; } ?> id="gd2" name="roundcleared[]" value="Group Discussion">
166  <label class="custom-control-label" for="gd2">Group Discussion</label>
167  </div>
168  <div class="custom-control custom-checkbox mb-3">
169  <input type="checkbox" class="custom-control-input" <?php if(in_array('1st Interview Round', $roundcleared)) { echo "checked"; } ?> id="int12" name="roundcleared[]" value="1st Interview Round">
170  <label class="custom-control-label" for="int12">1st Interview Round</label>
171  </div>
172  <div class="custom-control custom-checkbox mb-3">
173  <input type="checkbox" class="custom-control-input" <?php if(in_array('2nd Interview (HR) Round', $roundcleared)) { echo "checked"; } ?> id="int22" name="roundcleared[]" value="2nd Interview (HR) Round">
174  <label class="custom-control-label" for="int22">2nd Interview (HR) Round</label>
175  </div>
176  <br>
177  <div class="md-form mb-4 green-textarea active-green-textarea">
178  <label for="story">Your Story/Experience:</label>
179  <textarea id="story" class="md-textarea form-control" rows="12" placeholder="Please restrict yourself to 100 words . . ." name="story" required><?= ($row['story']) ?: $row['story'] ?></textarea>
180  </div>
181  <input class="btn btn-primary" type="submit" name="update" value="Update">
182  </form>
183  </div>
184  </div>
185  </div>
186  </div>
187 
188  <div class="footer">
189  <p style="color:#e88924">&#9400; Copyright@IITB</p>
190  </div>
191 
192 
193 
194 
195  <!-- Login popup scripts -->
196  <script src='https://code.jquery.com/jquery-3.3.1.slim.min.js'></script>
197  <script src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js'></script>
198  <script src='https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js'></script>
199  <script src="js/script.js"></script>
200 </body>
201 </html>