$results = DB\select_db("delete from events where volid=:volid", $binding, $conn); if ($results) { $msgdelete = "Volunteer deleted "; } } catch (Exception $e) { $msgdelete = 'some Server error encountered..'; } } } if (strcmp($_REQUEST['opt'], "edit") == 0) { //echo "uanme".$_POST['uid']; $conn = DB\connect_db($config); if ($conn) { $binding = array('volid' => $_POST['eid']); try { $resultedit = DB\query_db("select * from volunteers where volid=:volid", $binding, $conn); if ($resultedit) { echo ""; } } catch (Exception $e) { $msgedit = 'some Server error encountered..'; } } } if (strcmp($_REQUEST['opt'], "addu") == 0) { $conn = DB\connect_db($config); if ($conn) { $binding = array('volname' => $_POST['addname'], 'email' => $_POST['addemail'], 'mobile' => $_POST['addmobile'], 'branch' => $_POST['addbranch'], 'year' => $_POST['addyear']); try { $results = DB\insert_db("insert into volunteers(name,email,year,branch,mobile) \t\t\t\t\tvalues(:volname,:email,:year,:branch,:mobile)", $binding, $conn); if ($results) {
$results = DB\select_db("delete from events where eid=:eid", $binding, $conn); if ($results) { $msgdelete = "Event deleted "; } } catch (Exception $e) { $msgdelete = 'some Server error encountered..'; } } } if (strcmp($_REQUEST['opt'], "edit") == 0) { //echo "uanme".$_POST['uid']; $conn = DB\connect_db($config); if ($conn) { $binding = array('eid' => $_POST['eid']); try { $resultedit = DB\query_db("select * from events where eid=:eid", $binding, $conn); if ($resultedit) { echo ""; } } catch (Exception $e) { $msgedit = 'some Server error encountered..'; } } } if (strcmp($_REQUEST['opt'], "addu") == 0) { $conn = DB\connect_db($config); if ($conn) { $binding = array('name' => $_POST['eventname'], 'edate' => $_POST['eventdate'], 'efee' => $_POST['entryfee'], 'expentries' => $_POST['expentry']); try { $results = DB\insert_db("insert into events(name,edate,efee,expentries) \t\t\t\t\tvalues(:name,:edate,:efee,:expentries)", $binding, $conn); if ($results) {
$results = DB\select_db("delete from system_users where username=:uname", $binding, $conn); if ($results) { $msgdel = "user deleted successfully..."; } } catch (Exception $e) { $msgdel = 'some Server error encountered..'; } } } if (strcmp($_REQUEST['opt'], "edit") == 0) { //echo "uanme".$_POST['uid']; $conn = DB\connect_db($config); if ($conn) { $binding = array('uname' => $_POST['uid']); try { $resultedit = DB\query_db("select * from system_users where username=:uname", $binding, $conn); if ($resultedit) { echo ""; } } catch (Exception $e) { echo 'some Server error encountered..'; } } } if (strcmp($_REQUEST['opt'], "addu") == 0) { if (strcmp($_POST['password'], $_POST['conpassword'] == 0)) { $conn = DB\connect_db($config); if ($conn) { $binding = array('name' => $_POST['name'], 'email' => $_POST['email'], 'uname' => $_POST['uname'], 'password' => $_POST['password'], 'role' => $_POST['role']); try { $results = DB\insert_db("insert into system_users(name,email,role,password,username) \t\t\t\t\tvalues(:name,:email,:role,:password,:uname)", $binding, $conn);
?> <div class="ui-widget-header" id="menubar" > <div style="font-size: 32px; left: 25px;top:10px; font-family: 'CHE LIVES!', Starcraft;position:absolute;">COLOSSEUM <div style="font-size:15px;font-family:'Courier New', Courier, monospace;">Management System</div> </div> <p style="position:absolute;top:30px;left:49%"> <a href="../general/home.php"> <span class="ui-icon ui-icon-home" style="background-image: url(../style/images/ui-icons_222222_256x240.png);-webkit-transform: scale(1.5);" ></a> </p> </div> <?php $imagepath = ""; $conn = DB\connect_db($config); if ($conn) { $results = DB\query_db("select * from system_users where username=:id", array('id' => $_SESSION['username']), $conn); if ($results) { if (strcmp($results->pro_pic, "") == 0) { $imagepath = "../users/images/defaultuser.jpg"; } else { $imagepath = "../users/" . $_SESSION['username'] . "/" . $results->pro_pic; } } } ?> <div id="pane" > <!--<img id="pane" src="users/<?php //echo $_SESSION['username']."/";echo $pic; ?> " width="10px" height="100%" > -->
<?php session_start(); require_once '../settings/dbfunctions.php'; use Web\DB; $username = $_POST['uname']; $password = $_POST['passwd']; $conn = DB\connect_db($config); if ($conn) { $binding = array('id' => $username); $results = DB\query_db("select * from system_users where username=:id", $binding, $conn); if ($results) { if (strcmp($results->password, $password) == 0) { $_SESSION['username'] = $username; if (strcmp($results->role, "normal") == 0) { header("location:../general/home.php"); } if (strcmp($results->role, "admin") == 0) { header("location:../main/home.php"); } } else { session_destroy(); header('location:../index.php?type=inpass'); } } else { session_destroy(); header('location:../index.php?type=inuser'); } } else { echo "Connection lost"; die;