Exemplo n.º 1
0
<?php

#cousrse addition
require_once "../classes/database.php";
require_once "../classes/retrival.php";
if (isset($_REQUEST['Submit'])) {
    $c_name = $_REQUEST['name'];
    $c_category = $_REQUEST['category'];
    $c_level = $_REQUEST['level'];
    $c_price = $_REQUEST['price'];
    $db = new database();
    $db->connect();
    $rt = new retrieval();
    $c_id = $rt->courses();
    $query = "INSERT INTO course(course_id,c_name,c_category,c_level,c_price) VALUES('{$c_id}','{$c_name}','{$c_category}','{$c_level}','{$c_level}')";
    if (empty($db->execute($query))) {
        echo "0";
    } else {
        echo "1";
    }
    $db->disconnect();
} else {
    echo "0";
}
Exemplo n.º 2
0
 $d_subCity = $_REQUEST['dsubCity'];
 $d_subState = $_REQUEST['dsubState'];
 $d_subContact = $_REQUEST['dsubContact'];
 $doc_id = $_REQUEST['sub_doc'];
 $dot_id = "1";
 //$tb_type=$_REQUEST['tb_type'];
 $sub_type = $_REQUEST['sub_type'];
 $PhaseofTreatment = $_REQUEST['PhaseofTreatment'];
 $DiseasesClassification = $_REQUEST['DiseasesClassification'];
 //$subscriberDisease=$_REQUEST['subscriberDisease'];
 $sub_BloodGroup = $_REQUEST['bg_type'];
 //database
 $db = new Database();
 $db->connect();
 //Generation of ID
 $rt = new retrieval();
 $sub_id = $rt->subscriber();
 $con_id = $rt->contact_person();
 echo $con_id;
 $dot_id = $rt->dot_provider();
 //Adding Contact Person details
 $query = "INSERT INTO subscriber_contactpersons( user_id, contact_name, contact_contact, contact_address, contact_city, contact_state, contact_relation) VALUES('{$con_id}','{$c_subName}','{$c_subContact}', '{$c_subAddress}',  '{$c_subCity}', '{$c_subState}', '{$realtionship}')";
 if (empty($db->insertData($query))) {
     echo "Error in Contact";
 } else {
     $query = "INSERT INTO subscriber_dotprovider(user_id,dot_name,dot_address,dot_city,dot_state,dot_contact)\n\t\t\t\t\tVALUES('{$dot_id}','{$d_subName}','{$d_subAddress}','{$d_subCity}','{$d_subState}','{$d_subContact}')";
     if (empty($db->insertData($query))) {
         echo "Error in Dot";
     } else {
         $query = "INSERT INTO subscribers (user_id,contact_person_id,dot_id,doc_id,TB_no,TB_unit,Nikshay_no,Name_phi,sub_name,sub_sex,sub_DOB,sub_occupation,sub_contact,sub_address,sub_city,sub_state,sub_type,sub_blood_group) \n\t\t\t\t\t\tVALUES ('{$sub_id}','{$con_id}','{$dot_id}','{$doc_id}','{$TB_no}','{$TB_unit}','{$Nikshay_no}','{$Name_phi}','{$subName}','{$subSex}','{$subDOB}','{$subOccupation}','{$subContact}','{$subAddress}','{$subCity}','{$subState}','{$sub_type}','{$sub_BloodGroup}')";
         if (empty($db->insertData($query))) {
}
if (!empty($_REQUEST["Submit"])) {
    //input
    $firstname = $_POST["firstName"];
    $lastname = $_POST["lastName"];
    $user_name = $firstname . " " . $lastname;
    $reg_no = $_POST['regNo'];
    $domain = $_POST['domain'];
    $email = $_POST['username'];
    $pass = $_POST["password"];
    $unique_salt = unique_salt();
    $hash = sha1($unique_salt . $pass);
    $encrypted = encryptIt($hash);
    $pass = $encrypted;
    //creation of object
    $rt = new retrieval();
    $user_id = $rt->newuser();
    $db = new database();
    $db->connect();
    //encryption
    $encrypted = encryptIt($unique_salt);
    $unique_salt = $encrypted;
    $sql = "INSERT INTO users( userID,     user_name    , password , salt , registration_no , domain , email ) \n \t   \t  VALUES( '{$user_id}' , '{$user_name}' , '{$pass}' , '{$unique_salt}' , '{$reg_no}' , '{$domain}', '{$email}')";
    if (!empty($db->insertData($sql))) {
        echo "true";
    } else {
        echo "false";
    }
    $db->disconnect();
}
?>
Exemplo n.º 4
0
<?php

session_start();
require_once "../classes/database.php";
require_once "../classes/retrieval.php";
$db = new database();
$db->connect();
$c = $_REQUEST['com'];
$postid = $_POST['id'];
if (isset($_REQUEST['id'])) {
    $c = $_REQUEST['com'];
    $username = $_SESSION['username'];
    $rt = new retrieval();
    $comid = $rt->comment();
    $query = "INSERT INTO comment(comid,comment,postid,username) VALUES('{$comid}','{$c}','{$postid}','{$username}') ";
    $db = new database();
    $db->connect();
    $db->insertData($query);
}
Exemplo n.º 5
0
<?php

session_start();
require_once "../classes/database.php";
require_once "../classes/retrieval.php";
$var2 = $_REQUEST["id"];
$head = $_REQUEST["head"];
$db = new database();
$db->connect();
$query = "SELECT * from users where username='******'sess_user'] . "'";
if (mysqli_num_rows($db->selectData($query)) > 0) {
    $query = "SELECT * from skill where username='******'sess_user'] . "'";
    if (mysqli_num_rows($db->selectData($query)) == 0) {
        $rt = new retrieval();
        $skill_id = $rt->skill();
        $userid = $_SESSION['sess_user'];
        $query = "INSERT INTO skill (skill_id , username ,head ) VALUES( '{$skill_id}' , '{$userid}','{$head}') ";
        $db->insertData($query);
    } else {
        while ($row = mysqli_fetch_array($db->selectData($query))) {
            $skill_id = $row['skill_id'];
            break;
        }
    }
} else {
    echo "Daabse not updated";
}
$targetfolder = "../skill_content/";
if (isset($GLOBALS['skill_id'])) {
    if (!is_dir($targetfolder)) {
        mkdir($targetfolder);
Exemplo n.º 6
0
<?php

#insert section
session_start();
require_once "../classes/database.php";
require_once "../classes/retrival.php";
$db = new database();
$db->connect();
if (isset($_REQUEST['Submit'])) {
    $v_name = $_REQUEST['name'];
    $v_detail = $_REQUEST['detail'];
    $v_section = $_REQUEST['section'];
    $rt = new retrieval();
    $v_id = $rt->video();
    $query = "SELECT * from section where s_name='{$v_section}'";
    $result = $db->execute($query);
    if (mysqli_num_rows($result) > 0) {
        while ($row = mysqli_fetch_array($result)) {
            $s = $row['section_id'];
            //	echo $c;
        }
        $_SESSION['name'] = $v_name;
        $_SESSION['detail'] = $v_detail;
        $_SESSION['v_id'] = $v_id;
        $_SESSION['section'] = $GLOBALS['s'];
    }
} else {
    echo "0";
}
Exemplo n.º 7
0
require_once "../classes/database.php";
require_once "../classes/retrival.php";
$db = new database();
$db->connect();
if (isset($_REQUEST['Submit'])) {
    $s_name = $_REQUEST['name'];
    $s_details = $_REQUEST['detail'];
    $c_name = $_REQUEST['course'];
    $query = "SELECT * from course where c_name='{$c_name}'";
    $result = $db->execute($query);
    if (mysqli_num_rows($result) > 0) {
        while ($row = mysqli_fetch_array($result)) {
            $c = $row['course_id'];
            //	echo $c;
        }
        $c_id = $GLOBALS['c'];
        $_SESSION['course_id'] = $c_id;
        $rt = new retrieval();
        $s_id = $rt->section();
        $query = "INSERT INTO section(section_id, course_id, s_name, s_detail)\n\t\t\t        VALUES('{$s_id}', '{$c_id}', '{$s_name}', '{$s_details}')";
        if (empty($db->execute($query))) {
            echo "0";
        } else {
            echo "1";
        }
    } else {
        echo "not working";
    }
} else {
    echo "0";
}
Exemplo n.º 8
0
<?php

session_start();
require_once '../classes/database.php';
require_once '../classes/retrieval.php';
#error_reporting(0);
$var2 = $_REQUEST["id"];
$head = $_REQUEST["head"];
$db = new database();
$db->connect();
$query = "SELECT * from users where email='" . $_SESSION['sess_user'] . "'";
if (mysqli_num_rows($db->selectData($query)) > 0) {
    $rt = new retrieval();
    $event_id = $rt->events();
    echo $event_id;
    $row = mysqli_fetch_array($db->selectData($query));
    $domain = $row['domain'];
    $userid = $row['userID'];
    $query = "INSERT INTO events (event_id , event_name, event_domain ) VALUES( '{$event_id}' , '{$head}' , '{$domain}') ";
    $db->insertData($query);
} else {
    echo "Daabse not updated";
}
$targetfolder = "../content/";
if (!is_dir($targetfolder)) {
    mkdir($targetfolder);
}
if (!is_dir($targetfolder . $GLOBALS['domain'])) {
    mkdir($targetfolder . $GLOBALS['domain']);
}
if (!file_exists($targetfolder . $GLOBALS['domain'] . "/" . $head . ".json")) {
Exemplo n.º 9
0
<?php

session_start();
require_once "../classes/database.php";
require_once "../classes/retrieval.php";
$user = $_SESSION['sess_user'];
if (isset($_REQUEST['submit'])) {
    echo "user";
    $db = new database();
    $db->connect();
    $rt = new retrieval();
    $postid = $rt->post();
    $post = $_REQUEST['post'];
    $user = $_SESSION['sess_user'];
    $query = "INSERT INTO post(postid,post,user,upvote,downvote) VALUES('{$postid}','{$post}','{$user}',0,0)";
    if (empty($db->insertData($query))) {
        echo "error";
    }
}
Exemplo n.º 10
0
<?php 
if (isset($_POST['fname'])) {
    $fname = $_POST['fname'];
    $lname = $_POST['lname'];
    $name = $fname . " " . $lname;
    $sex = $_POST['sex'];
    $dob = $_POST['dob'];
    $type = @$_POST['type_doc'];
    $add1 = $_POST['add1'];
    $add2 = $_POST['add2'];
    $city = $_POST['city'];
    $state = $_POST['state'];
    $phn1 = $_POST['ph1'];
    $phn2 = $_POST['ph2'];
    $email = $_POST['email1'];
    $db = new Database();
    $db->connect();
    $rt = new retrieval();
    $usid = $rt->docter();
    //echo "INSERT INTO med_officials (user_id,official_name,official_sex,official_DOB,official_type,official_contact1,official_contact2,official_address,official_city,official_state,official_email) values ('$usid','$name','$sex','$dob','$type','$phn1','$phn2','$add1','$city','$state','$email'";
    $query = "INSERT INTO med_officials (user_id,official_name,official_sex,official_DOB,official_type,official_contact1,official_contact2,official_address,official_city,official_state) values ('{$usid}','{$name}','{$sex}','{$dob}','{$type}','{$phn1}','{$phn2}','{$add1}','{$city}','{$state}')";
    if (empty($db->insertData($query))) {
        echo "Working";
    } else {
        echo "The Doctor id is " . $usid;
    }
    $query = "insert into users(user_id,password,type_of_user,user_verified) VALUES('{$usid}','2','{$usid}','1')";
    $db->insertData($query);
    $db->disconnect();
    //echo "data inserted";
}