<?php

$db = mysql_connect(“localhost”, “user”);
Mysql_select_db(“PA_Database”);
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db(DB_NAME, $link);
if (!$db_selected) {
    die('Can\'t use ' . DB_NAME . ': ' . mysql_error());
}
if (isset($_POST['Save'])) {
    $loc = $_POST['location'];
    $date = $_POST['date'];
    $time = $_POST['time'];
    $wState = $_POST['wState'];
    $desc = $_POST['sDesc'];
    $sql = "INSERT into accinfo (accidentNo, location, time, date, eyeWitnessDetails, sceneDescription) values ({$aInfo}, {$loc}, {$time}, {$date}, {$wState}, {$desc})";
    $result = mysql_query($sql);
}
          </tr>
         <tr>
            <td>&nbsp;</td>
          </tr>
         
 
  <fieldset>
    <legend>CASE MANAGER WIZARD</legend>
    <table cellspacing="10">
	   <tr>
	     <?php 
$con = mysql_connect('localhost', 'root', '');
if (!$con) {
    die('Could not connect: ' . mysql_error());
}
Mysql_select_db("test", $con);
$B = "select firstname, lastname, empid, i94expirydate, email, responsereceived, filelocation1, filelocation2 from reminders LIMIT 10";
$result = mysql_query($B) or die(mysql_error());
$num = mysql_numrows($result);
echo "<table border='1' width='100' height='10' cellpadding='5' cellspacing='5'>";
echo "<th colspan='12'>Approve/Reject Ticket Status</th>";
echo "<tr>";
echo "<td> <b>FIRST NAME </b></td>";
echo "<td> <b>LAST NAME</b> </td>";
echo "<td><b> EMPID </b> </td>";
echo "<td><b>I94 Expiry Date<b></td>";
echo "<td><b>Email Sent To</b></td>";
echo "<td> <b>Response Received from Employee</b></td>";
echo "<td> <b>Filelocation for Copy of I94 Doc<h> </td>";
echo "<td> <b>Filelocation for copy of Passport Doc<h> </td>";
echo "<td><b>Approve/Reject</b></td>";
Beispiel #3
0
<?php

$con = mysql_connect('localhost', 'aztoolz', 'bluehost');
if (!$con) {
    die('Could not connect: ' . mysql_error());
}
Mysql_select_db("aztoolz", $con);
$y = "Select * from finalresult";
$resulty = mysql_query($y) or die(mysql_error());
$num = mysql_numrows($resulty);
if (isset($_POST['upload'])) {
    $file_name = $_FILES['uploaded']['name'];
    echo $type = $_FILES['uploaded']['type'];
    $size = $_FILES['uploaded']['size'];
    $_FILES['uploaded']['tmp_name'];
    if ($type == "text/csv") {
        $target = "upload/";
        $tempname = basename($_FILES['uploaded']['name']);
        $target = $target . $tempname;
        move_uploaded_file($_FILES['uploaded']['tmp_name'], $target);
        $status = "File Successfully uploaded to the server";
        $w = "INSERT INTO finalresult(filelocation, status) VALUES ('" . $target . "','" . $status . "')";
        mysql_query($w) or die(mysql_error());
        $maxid = mysql_insert_id();
        $handle = fopen($target, "r");
        while (($data = fgetcsv($handle, 0, ",")) !== FALSE) {
            $emp = str_pad(trim($data[0]), 6, '0', STR_PAD_LEFT) . "744";
            $udat = date("Y-m-d", strtotime($data[7]));
            if ($data[3] == "H1B" || $data[3] == "H1" || $data[3] == "H1 B") {
                $visaty = "H1";
            } else {
<?php

// database variables
$hostname = "mysql.eecs.ku.edu";
$sqluser = "******";
$sqlpass = "******";
$dbname = "jamiller";
session_start();
$error = '';
// Connect to database
$conn = mysql_connect($hostname, $sqluser, $sqlpass);
Mysql_select_db($dbname);
$this_id = isset($_GET['article_id']) ? $_GET['article_id'] : '1';
if (isset($_POST['make_new'])) {
    var_dump("Save the post");
    $query = 'INSERT INTO ARTICLE (USERNAME, TITLE, TEXT)';
    $query = $query . 'VALUES ("' . $_SESSION['user'] . '", "' . $_POST["article_title"] . '", "' . $_POST["article_body"] . '" ) ';
    mysql_query($query, $conn);
}
if (isset($_POST['article_title']) && isset($_POST['article_body']) && isset($_POST['save'])) {
    $query = 'UPDATE ARTICLE SET TITLE="' . $_POST["article_title"];
    $query = $query . '", TEXT="' . $_POST["article_body"];
    $query = $query . '" WHERE ARTICLE_ID=' . $this_id;
    mysql_query($query, $conn);
}
$query = "SELECT TITLE, USERNAME, TEXT FROM ARTICLE WHERE ";
$query = $query . "ARTICLE_ID='{$this_id}'";
$featured_article = mysql_query($query, $conn);
$query = "SELECT TITLE, USERNAME, ARTICLE_ID FROM ARTICLE";
$panel_articles = mysql_query($query, $conn);
$is_new = isset($_GET['new']) && $_GET['new'] == '0';
Beispiel #5
0
<?php 
$itest = mysql_connect("localhost", "root", "");
Mysql_select_db("test", $itest);
$query_petdet = sprintf("SELECT MAX(ID) as maxid FROM eweight1");
$petdet = mysql_query($query_petdet, $itest) or die(mysql_error());
$row_petdet = mysql_fetch_assoc($petdet);
echo $row_petdet['maxid'];
?>
<html>
<body>
</body>
</html>
Beispiel #6
0
    Mysql_select_db("ushere", $con);
    echo $A = "update master_herelist SET fileuploadstatus=1 where empid='000377744'";
    $result = mysql_query($A) or die(mysql_error());
    $A = "update master_herelist SET responsereceived=1 where empid='000377744'";
    $result = mysql_query($A) or die(mysql_error());
    $A = "update master_herelist SET filelocation2= '" . $target1 . "' where empid='000377744' ";
    $result = mysql_query($A) or die(mysql_error());
}
?>
		  
  <?php 
if (isset($_POST['verified'])) {
    $con = mysql_connect('localhost', 'root', '');
    if (!$con) {
        die('Could not connect: ' . mysql_error());
    }
    Mysql_select_db("ushere", $con);
    $A = "update master_herelist SET responsereceived='1' where empid='000377744' ";
    $result = mysql_query($A) or die(mysql_error());
    $A = "update master_herelist SET reminder2='1' where empid='000377744' ";
    $result = mysql_query($A) or die(mysql_error());
    $A = "update master_herelist SET reminder3='1' where empid='000377744' ";
    $result = mysql_query($A) or die(mysql_error());
}
?>
   	   
 


</body>
</html>
Beispiel #7
0
<?php

session_start();
$name = $_POST['name'];
$password = $_POST['password'];
if ($name && $password) {
    $HostName = "localhost";
    $UserName = "******";
    $Password = "******";
    $DBName = "phplogin";
    $DBConnect = mysql_connect($HostName, $UserName, $Password) or die("Unable to connect to {$DBName}");
    Mysql_select_db($DBName) or die("Unable to select {$DBName}");
    $query = mysql_query("SELECT * FROM users WHERE name ='{$name}'");
    $numRows = mysql_num_rows($query);
    if ($numRows != 0) {
        while ($row = mysql_fetch_assoc($query)) {
            $dbName = $row['name'];
            $dbPassword = $row['password'];
        }
        //check to see if they match
        if ($name == $dbName && $password == $dbPassword) {
            echo "<div style=\"font-size:26px;height:500px;width:300px;margin:25vh auto;text-align:center\">";
            echo "Thanks for logging in " . $name . "!";
            echo "<br>";
            echo "<a href=\"schedule.php\"><button style=\"cursor:pointer;padding:5px;background:#5BB75B;font-size:21px;border-radius:5px;border:none;color:#fff; margin:30px auto;\">View Class Schedule</button></a>";
            echo "</div>";
            $_SESSION['name'] = $dbName;
        } else {
            echo "<h3 style=\"width:200px;height:100px;text-align:center;margin:0 auto;margin-top:25vh;\">Incorrect password!<br><a href=\"login.php\" style=\"text-decoration:none;color:#62C462\"><em>Please Try Again</em></a></h3>";
        }
    } else {