Example #1
0
                     $ret['message'] = 'Email cannot be empty!';
                 }
             } else {
                 $ret['message'] = 'Designation cannot be empty!';
             }
         } else {
             $ret['message'] = 'Username cannot be empty!';
         }
     } else {
         $ret['message'] = 'Name cannot be empty!';
     }
 } elseif ($operation == 'LOGIN') {
     $uname = htmlentities($_POST['uname'], ENT_QUOTES);
     $pass = sha1(md5(htmlentities($_POST['pass'], ENT_QUOTES)));
     if (!empty($uname) && !empty($pass)) {
         if ($data = $oDb->q_fetch("select * from user where uname = '{$uname}'")) {
             if ($data['pass'] === $pass) {
                 $_SESSION['username'] = $uname;
                 $_SESSION['LAST_ACTIVITY'] = time();
                 $ret['success'] = TRUE;
             } else {
                 $ret['message'] = 'Username & Password Doesn\'t match';
             }
         } else {
             $ret['message'] = 'User not registered yet.';
         }
     } else {
         $ret['message'] = 'Required Feild empty!';
     }
 } elseif ($operation == 'ADCLS') {
     $clsname = htmlentities($_POST['classname'], ENT_QUOTES);
Example #2
0
                     $ret['message'] = 'Email cannot be empty!';
                 }
             } else {
                 $ret['message'] = 'Designation cannot be empty!';
             }
         } else {
             $ret['message'] = 'Username cannot be empty!';
         }
     } else {
         $ret['message'] = 'Name cannot be empty!';
     }
 } elseif ($operation == 'LOGIN') {
     $uname = htmlentities($_POST['uname'], ENT_QUOTES);
     $pass = sha1(md5(htmlentities($_POST['pass'], ENT_QUOTES)));
     if (!empty($uname) && !empty($pass)) {
         if ($data = $oDb->q_fetch("select * from user where uname = '{$uname}'")) {
             if ($data['pass'] === $pass) {
                 $_SESSION['username'] = $uname;
                 $_SESSION['LAST_ACTIVITY'] = time();
                 $ret['success'] = TRUE;
                 $ret['redirect'] = TRUE;
                 $ret['redirect_to'] = '../';
             } else {
                 $ret['message'] = 'Username & Password Doesn\'t match';
             }
         } else {
             $ret['message'] = 'User not registered yet.';
         }
     } else {
         $ret['message'] = 'Required Feild empty!';
     }
Example #3
0
<?php

require_once '../func/functions.php';
$oDb = new Database();
$oCheck = new Check();
$oTools = new Tools();
if (!empty($_POST)) {
    $operation = $_POST['OP'];
    if ($operation == 'CNGSEC') {
        $val = $_POST['val'];
        $qr = $oDb->q_fetch("select * from class where class = '{$val}' order by class");
        echo '<option value="">Select Section</option>
                <option value="1">' . $qr['c_sec1'] . '</option>
                <option value="2">' . $qr['c_sec2'] . '</option>
                <option value="3">' . $qr['c_sec3'] . '</option>';
    } elseif ($operation == 'STULST') {
        $class = $_POST['class'];
        $sec = $_POST['section'];
        $qr = $oDb->query("select * from student where class = '{$class}' and s_section = '{$sec}' order by class");
        echo '<option value="" default>Select Student</option>';
        while ($data = $oDb->fetch($qr)) {
            echo '<option value="' . $data['stuid'] . '">' . $data['s_name'] . '</option>';
        }
    } elseif ($operation == 'SUBLST') {
        $class = $_POST['class'];
        $sec = $_POST['section'];
        $id = $_POST['stuid'];
        $qr = $oDb->query("select * from class_subject where class = '{$class}' and section = '{$sec}'");
        echo '<input type="hidden" name="stuid" value="' . $id . '"/><h4>List of the subjects</h4>';
        while ($d = $oDb->fetch($qr)) {
            echo '<div class="col-md-4"><div class="col-sm-7 pl0"><input type="hidden" name="sub_name[]" value="' . $d['subname'] . '"/><label>' . $d['subname'] . ':</label></div><div class="col-sm-5 pr0"><input type="text" name="marks[]" class="form-control" placeholder="Mark"/></div></div>';
Example #4
0
<?php

$oDb = new Database();
$data;
if (!empty($_GET['edit'])) {
    $edtId = $_GET['edit'];
    $GLOBALS['data'] = $oDb->q_fetch("select * from j_user where u_id = '{$edtId}'");
    // print_r($GLOBALS['data']);
}
//    function detectMode($edtId){
//        if(!empty($edtId)) {
//            echo 'edit';
//        } else echo 'add';
//    }
//    detectMode($edtId);
function setValue($fieldname)
{
    if (!empty($GLOBALS['data'])) {
        echo $GLOBALS['data'][$fieldname];
    }
}
?>
<!--breadcrumbs start-->
<div id="breadcrumbs-wrapper" class=" grey lighten-3">
    <div class="container">
        <div class="row">
            <div class="col s12 m12 l12">
                <h5 class="breadcrumbs-title">Users</h5>
                <ol class="breadcrumb">
                    <li><a href="index.php">Dashboard</a>
                    </li>
Example #5
0
                    $ret['message'] = 'Successfully Deleted';
                } else {
                    $ret['message'] = 'Failed! Cannot delete item';
                }
            } else {
                $ret['message'] = 'Failed! No table given';
            }
        } else {
            $ret['message'] = 'Failed! Key value missing';
        }
    } elseif ($operation == 'view') {
        if (isset($_POST['id']) && !empty($_POST['id'])) {
            if (!empty($_POST['table'])) {
                $id = $_POST['id'];
                $table = $_POST['table'];
                if ($res = $oDb->q_fetch("select * from {$table} where u_id = '{$id}'")) {
                    $ret['success'] = true;
                    $ret['message'] = 'Successfully Opened';
                    //                    $data = array('name'=>($res['u_fname'].' '.$res['u_lname']), 'username'=>$res['u_username'], 'role'=> $res['u_role'], 'email'=>$res['u_email'], 'phone'=> $res['u_mob'], 'dob'=>$res['u_dob'], 'msg'=>$res['u_msg']);
                    //                    echo json_encode($data);
                } else {
                    $ret['message'] = 'Query Failed!';
                }
            } else {
                $ret['message'] = 'Failed! No table given';
            }
        } else {
            $ret['message'] = 'Failed! Key value missing';
        }
    }
}