Example #1
0
<?php 
require_once "../control/include/dbConstants.php";
// get the uri segment so I can use the correct row to edit.
// ****************** from timwickstrom.com ************************
function getUri()
{
    return explode("/", parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
}
// ****************** from timwickstrom.com ************************
function getUriSegment($n)
{
    $segs = getUri();
    return count($segs) > 0 && count($segs) >= $n - 1 ? $segs[$n] : '';
}
$pharmacy = getUriSegment(4);
$sql = "SELECT * FROM pharmacy WHERE pharmacy = '{$pharmacy}';";
$result = mysqli_query($db, $sql) or die(mysqli_connect_error());
$cols = mysqli_fetch_assoc($result);
$db->close();
?>
	<body>
		<form id="pharm" action="../../control/pharmUpdate.php" method="POST">
			<legend>Pharmacy</legend>
			<input type="text" name="pharmacy" value="<?php 
echo $cols['pharmacy'];
?>
" />

			<legend>Phone number</legend>
			<input type="text" name="pharmNum" value="<?php 
Example #2
0
admin/user/user.php">users</a></li>
                    <li><a style="<?php 
echo getUriSegment(3) == 'starter' ? 'text-decoration: underline' : '';
?>
" 
                           href="<?php 
echo WEBSITE_URL;
?>
admin/starter/starters.php">starters</a></li>
                    <li><a style="<?php 
echo getUriSegment(3) == 'banner' ? 'text-decoration: underline' : '';
?>
" 
                           href="<?php 
echo WEBSITE_URL;
?>
admin/banner/banner.php">banners</a></li>
                    <li><a style="<?php 
echo getUriSegment(3) == 'administrator' ? 'text-decoration: underline' : '';
?>
" 
                           href="<?php 
echo WEBSITE_URL;
?>
admin/administrator/administrator.php">administrators</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<!--menu div end-->
Example #3
0
<?php 
require_once '../control/include/dbConstants.php';
// get the uri segment so I can use the correct row to edit.
// ****************** from timwickstrom.com ************************
function getUri()
{
    return explode("/", parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
}
// ****************** from timwickstrom.com ************************
function getUriSegment($n)
{
    $segs = getUri();
    return count($segs) > 0 && count($segs) >= $n - 1 ? $segs[$n] : '';
}
$drug = getUriSegment(4);
//echo $drug;
// $sql = "SELECT * FROM medications WHERE Drug = '$drug';";
// $return = mysqli_query($db, $sql);
// if ($db->query($sql) === TRUE) {
// 	echo "Record deleted successfully<br><br>";
// }
// 	else {
//     echo "Error editing record: " . $db->error;
// }
$sql = "SELECT * FROM medications WHERE Drug = '{$drug}';";
$result = mysqli_query($db, $sql) or die(mysqli_connect_error());
$cols = mysqli_fetch_assoc($result);
$db->close();
?>
                <li class="menu-item <?php 
echo getUriSegment(2) == 'about' ? 'current_page_item' : false;
?>
">
                    <a href="<?php 
echo $baseURL . 'about';
?>
">About us</a>
                </li>
                <li class="menu-item <?php 
echo getUriSegment(2) == 'menu' ? 'current_page_item' : false;
?>
">
                    <a href="<?php 
echo $baseURL . 'menu';
?>
">Menu</a>
                </li>
                <li class="menu-item <?php 
echo getUriSegment(2) == 'contact' ? 'current_page_item' : false;
?>
">
                    <a href="<?php 
echo $baseURL . 'contact';
?>
">Contact</a>
                </li>
            </ul>
        </div>
    </div>
</nav>
Example #5
0
<?php 
require_once '../control/include/dbConstants.php';
// get the uri segment so I can use the correct row to edit.
// ****************** from timwickstrom.com ************************
function getUri()
{
    return explode("/", parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
}
// ****************** from timwickstrom.com ************************
function getUriSegment($n)
{
    $segs = getUri();
    return count($segs) > 0 && count($segs) >= $n - 1 ? $segs[$n] : '';
}
$doctors = getUriSegment(4);
$sql = "SELECT * FROM doctors WHERE doctors = '{$doctors}';";
$result = mysqli_query($db, $sql) or die(mysqli_connect_error());
$cols = mysqli_fetch_assoc($result);
$db->close();
?>

	<body>
		<div id="container">
		<div id="main">

			<h2>Edit Medication</h2>

			<form method="POST" action="../../control/docUpdate.php">

				<label>Doctor's name?</label>
Example #6
0
<?php 
session_start();
require_once '../control/include/dbConstants.php';
// get the uri segment so I can use the correct row to edit or delete.
// ****************** from timwickstrom.com ************************
function getUri()
{
    return explode("/", parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
}
// ****************** from timwickstrom.com ************************
function getUriSegment($n)
{
    $segs = getUri();
    return count($segs) > 0 && count($segs) >= $n - 1 ? $segs[$n] : '';
}
$object = getUriSegment(4);
//****************** Delete record of drug *********************
$sql = "DELETE FROM medications WHERE Drug = '{$object}';";
$return = mysqli_query($db, $sql);
//****************** Delete record of doctor *********************
$sql = "DELETE FROM doctors WHERE doctors = '{$object}';";
$return = mysqli_query($db, $sql);
//****************** Delete record of pharmacy *********************
$sql = "DELETE FROM pharmacy WHERE pharmacy = '{$object}';";
$return = mysqli_query($db, $sql);
if ($db->query($sql) === TRUE) {
    echo $object . " deleted successfully<br><br>";
} else {
    echo "Error deleting record: " . $db->error;
}
$db->close();