Esempio n. 1
0
    if (isset($_POST["weekDay"])) {
        $typeID = UserControl::getUserNo();
        $typeID = getInfo($typeID)["ID"];
        $thisWeek = date("w");
        $currentDate = date("Y-m-d");
        $target_day = $_POST["weekDay"];
        $weekDayArray = array("Sun" => "sunday", "Mon" => "monday", "Tue" => "tuesday", "Wed" => "wednesday", "Thur" => "thursday", "Fri" => "friday", "Sat" => "saturday");
        foreach ($weekDayArray as $key => $value) {
            if (isset($target_day[$key])) {
                $currentDate = date("Y-m-d");
                for ($i = 0; $i < $_POST["repeatTime"]; $i++) {
                    $nextDate = date("Y-m-d", strtotime('next ' . $value, strtotime($currentDate)));
                    markJobDate($typeID, $nextDate, $_POST["district"]);
                    $currentDate = $nextDate;
                }
            }
        }
    } else {
        echo "<script> alert('Please select the week day!'); </script>";
    }
} else {
    if (isset($_POST["date"], $_POST["district"])) {
        $typeID = UserControl::getUserNo();
        $typeID = getInfo($typeID)["ID"];
        markJobDate($typeID, $_POST["date"], $_POST["district"]);
    }
}
echo "<script> window.location.replace(\"../profile.php?userNo=" . UserControl::getUserNo() . "\"); </script>";
?>
		
Esempio n. 2
0
include_once "Brain/User.php";
include "header1.php";
?>
<link href="css/register.css" rel="stylesheet" type="text/css" />
<script src='js/register.js'> </script>
<?php 
include "Brain/District.php";
include "Brain/UserControl.php";
include "header2.php";
include_once "Brain/ShoppingCart.php";
$cart = new SCart();
if (isset($_GET["error"])) {
    echo "<script> alert('Sorry, we only delivery two day after order.')</script>";
}
if (UserControl::checkState() && UserControl::getType() == 'c') {
    $cust = getCustomer(getInfo(UserControl::getUserNo())[ID]);
    if (isset($_POST[distNo], $_POST[custAddr], $_POST["sdate"])) {
        $date = strtotime($_POST["sdate"]);
        $minday = strtotime(date("Y-m-d", strtotime("+ 2 days")));
        if ($date < $minday) {
            header("Location: checkout.php?error=true");
        } else {
            if ($cart->checkout($_POST["sdate"], "100", $_POST[custAddr], $cust[custNo], $_POST[distNo])) {
                header("Location: shoppingcart.php?sucess=true");
            } else {
                echo "<script> alert('Sorry!');</script>";
            }
        }
    }
    $district = getAllDistricts();
    $box = "<select name='distNo'>";
Esempio n. 3
0
<?php

include_once "Brain/field_const.php";
include "header1.php";
?>
<link href="css/profile.css" rel="stylesheet" type="text/css" />
<script src='js/profile.js'> </script>
<?php 
include "header2.php";
if (!isset($_GET[userNo])) {
    return;
}
$isOwner = false;
include_once "Brain/UserControl.php";
if (UserControl::checkState()) {
    $userNo = UserControl::getUserNo();
    if ($userNo == $_GET[userNo]) {
        $isOwner = !$isOwner;
    }
}
$owner = getUser($_GET[userNo]);
if (!isset($owner)) {
    echo "Sorry, No such user!";
    return;
}
$ownerInfo = getInfo($_GET[userNo]);
$type = getUserType($_GET[userNo]);
$typeID = $ownerInfo["ID"];
?>

<div id="profileHeader">
Esempio n. 4
0
					</div>
				</div>
			</div>
			<?php 
}
?>
			<div class="navTab col-10 col-m-20">
				<div><span class="fa fa-2x fa-search userIcon navIcon" onclick="showSearchBar()"></span></div>
			</div>
			<div class="navTab col-10 col-m-20">
				
				<?php 
include_once "UserControl.php";
echo '<div><span class="fa fa-2x fa-user userIcon navIcon" onclick="';
if (UserControl::checkState()) {
    echo "window.location = 'profile.php?userNo=" . UserControl::getUserNo() . "'\"";
} else {
    echo 'showLoginPanel()';
}
echo "\"></span></div>";
?>
			</div>
			
			
			
		</div>
		
		<div class="searchBar">
			<form action="products.php" method="get" style="margin:0;">
				<div class="searchInfo_C" style="width:700px">
					<label>Name:</label>
Esempio n. 5
0
<?php

include_once "UserControl.php";
if (isset($_POST[loginName], $_POST[loginPswd])) {
    echo $_POST[loginName];
    echo $_POST[loginPswd];
    if (UserControl::login($_POST[loginName], $_POST[loginPswd])) {
        echo header("Location: ../profile.php?userNo=" . UserControl::getUserNo());
    } else {
        echo "Failure to login";
    }
    echo "<a href='checkState.php' > HI </a>";
}