예제 #1
0
    echo addService($userid, $servicename, $hourlyrate);
}
//task addService
if ($task == "insertNewTime") {
    $customerid = $request->customerid;
    $serviceid = $request->serviceid;
    $hours = $request->hours;
    $date = $request->date;
    $desc = $request->desc;
    $weeklyid = getNewWeeklyID($userid);
    echo insertNewTime($userid, $customerid, $serviceid, $hours, $date, $desc, $weeklyid);
}
//task insertNewTime
if ($task == "getTimes") {
    $date = $request->date;
    echo getTimes($userid, $date);
}
//task getTimes
if ($task == "deleteRow") {
    $weeklyid = $request->weeklyid;
    $weeklyid = convertForInsert($weeklyid);
    $userid = convertForInsert($userid);
    $data = deleteRow($userid, $weeklyid);
    echo json_encode($data);
}
//task deleteRow
if ($task == "deleteSingle") {
    $timeid = $request->timeid;
    $weeklyid = $request->weeklyid;
    $data = deleteSingle($userid, $timeid, $weeklyid);
    echo json_encode($data);
예제 #2
0
$result = $conn->runsql($query, $dbcon);
while ($row = mysqli_fetch_object($result)) {
    $holidays[] = $row->date;
}
$query = "SELECT user_id,user_mail,last_entry_on,create_date FROM amz_login where user_id='{$curret_user_id}'";
$result = $conn->runsql($query, $dbcon);
while ($row = mysqli_fetch_object($result)) {
    $current_user = $row->user_id;
    $last_entry_date = $row->last_entry_on == "" ? $row->create_date : $row->last_entry_on;
    $today_date = date('Y-m-d', $_SERVER['REQUEST_TIME']);
    $aryDates = createDateRangeArray($last_entry_date, $today_date);
    $size = sizeof($aryDates);
    for ($i = 0; $i < $size; $i++) {
        if (!in_array($aryDates[$i], $holidays)) {
            $single_date = $aryDates[$i];
            $time_diff = getTimes($single_date, $today_date);
            if ($time_diff >= 24) {
                $tot_hrs = 0;
                $query_1 = "SELECT time FROM user_tasks WHERE date='{$single_date}' AND user_id='{$current_user}'";
                $result_1 = $conn->runsql($query_1, $dbcon);
                if (mysqli_num_rows($result_1)) {
                    while ($result_row_1 = mysqli_fetch_object($result_1)) {
                        //$tot_hrs = $tot_hrs + $result_row_1->time;
                        $tot_hrs += strtotime($result_row_1->time) - strtotime("00:00:00");
                    }
                    //echo $tot_hrs;
                    if ($tot_hrs < 28800) {
                        $pending_dates[] = $single_date;
                    }
                } else {
                    $pending_dates[] = $single_date;
예제 #3
0
파일: cron.php 프로젝트: Jacquesvw/phpBMS
    $querystatement .= "\n\t\t\t`scheduler`\n\t\t";
}
//end if
$querystatement .= " WHERE\n\t\t\t`scheduler`.inactive = '0'\n\t\t\tAND `scheduler`.startdatetime < NOW()\n\t\t\tAND (`scheduler`.enddatetime > NOW() OR `scheduler`.enddatetime IS NULL)\n\t";
$queryresult = $db->query($querystatement);
while ($schedule_record = $db->fetchArray($queryresult)) {
    $datetimearray = explode(" ", $schedule_record["startdatetime"]);
    $schedule_record["startdate"] = stringToDate($datetimearray[0], "SQL");
    $schedule_record["starttime"] = stringToTime($datetimearray[1], "24 Hour");
    if ($schedule_record["enddatetime"]) {
        $datetimearray = explode(" ", $schedule_record["enddatetime"]);
        $schedule_record["enddate"] = stringToDate($datetimearray[0], "SQL");
        $schedule_record["endtime"] = stringToTime($datetimearray[1], "24 Hour");
    }
    //endif enddateiem
    $validTimes = getTimes($schedule_record);
    if (is_array($validTimes) && in_array($now, $validTimes)) {
        switch ($schedule_record["type"]) {
            case "job":
                $success = @(include $schedule_record["job"]);
                break;
            case "pushrecord":
                include_once "../../modules/api/include/push.php";
                //try to include table specific functions
                $tableFile = "../../modules/" . $schedule_record["modulename"] . "/include/" . $schedule_record["maintable"] . ".php";
                if (file_exists($tableFile)) {
                    include_once $tableFile;
                }
                $push = new push($db, $schedule_record["pushrecordid"]);
                $success = $push->process();
                break;
예제 #4
0
 switch ($_REQUEST['action']) {
     case 'get_products':
         if ($user_longitude && $user_latitude) {
             getProducts($user_longitude, $user_latitude);
         }
         break;
     case 'get_prices':
         // echo 'start_long' . $user_longitude .'<br/>';
         // echo 'start_lat' . $user_latitude .'<br/>';
         // echo 'dest_long' . $destination_longitude . '<br/>';
         // echo 'dest_lat' . $destination_latitude . '<br/>';
         $price_to_venue = getPrices($user_longitude, $user_latitude, $destination_longitude, $destination_latitude);
         print_r(json_encode($price_to_venue));
         break;
     case 'get_times':
         getTimes($user_longitude, $user_latitude, $product_id);
         break;
     case 'search_foursquare':
         if ($venue_id) {
             $foursquare_url = 'https://api.foursquare.com/v2/venues/' . $venue_id;
             $foursquare_data = '?client_id=WTOCBAXWSLCPNIR4RIEPMGSKAGOF2YFWPE5W2GBLWKO5NRNJ&client_secret=K3S4LHTYSIR1YWWSGRFZ0A5DIST5H1C3XM55IVXBLEVTDR0O';
             $foursquare_data .= '&v=20140806&m=foursquare';
             $foursquare_results = fourSquareAPI($foursquare_url, $foursquare_data);
             $return_data = $foursquare_results->response->venue;
             $encoded_data = json_encode($return_data);
             print_r($encoded_data);
         } else {
             if ($radius) {
                 $foursquare_url = 'https://api.foursquare.com/v2/venues/explore';
                 $foursquare_data = '?ll=' . $user_latitude . ',' . $user_longitude;
                 $foursquare_data .= '&radius=' . $radius;
예제 #5
0
파일: vsa.php 프로젝트: BlackMac/timetrack
{
    $tt->parseData();
    $ld = $tt->getLastDay();
    //print_r($ld);
    echo (isset($ld['diff']) ? $ld['diff'] : 0) . "\n";
    echo (isset($ld['monthdiff']) ? $ld['monthdiff'] : 0) . "\n";
    echo (isset($ld['laststateIn']) ? (int) $ld['laststateIn'] : 0) . "\n";
    echo (isset($ld['start']) ? $ld['start'] : 0) . "\n";
    echo (isset($ld['pause']) ? $ld['pause'] : 0) . "\n";
}
error_reporting(E_ALL);
ini_set("display_errors", 1);
$action = isset($_GET['a']) ? $_GET['a'] : '';
$hash = isset($_GET['h']) ? $_GET['h'] : '';
if (!$tt->login(null, null, $hash)) {
    die('INVALID LOGIN');
}
$curmonth = date("Ym");
if (isset($_GET['m'])) {
    $curmonth = $_GET['m'];
}
$tt->setMonth($curmonth);
if ($action == "times") {
    getTimes($tt);
}
if ($action == "login") {
    getTimes($tt);
}
if ($action == "logout") {
    getTimes($tt);
}
예제 #6
0
{
    if ($uri['s'] == 'http://id.southampton.ac.uk/point-of-service/42-cafe') {
        return;
    }
    global $endpoint;
    //echo "<h1>".$uri['l']." (".$uri['s'].")</h1>";
    $allopen = sparql_get($endpoint, "\nPREFIX gr: <http://purl.org/goodrelations/v1#>\n\nSELECT ?day ?opens ?closes ?start ?end WHERE {\n  <" . $uri['s'] . "> gr:hasOpeningHoursSpecification ?o.\n  OPTIONAL { ?o gr:validFrom ?start . }\n  OPTIONAL { ?o gr:validThrough ?end . }\n  ?o gr:hasOpeningHoursDayOfWeek ?day .\n  ?o gr:opens ?opens .\n  ?o gr:closes ?closes .\n}\n\t");
    processOpeningTimes($allopen, $uri['s']);
}
$uris = sparql_get($endpoint, "\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX oo: <http://purl.org/openorg/>\n\nSELECT DISTINCT ?s ?l ?i WHERE {\n  ?s <http://purl.org/goodrelations/v1#hasOpeningHoursSpecification> ?o .\n  ?s rdfs:label ?l .\n  ?s oo:mapIcon ?i .\n} ORDER BY ?l\n");
$opening = array();
$noopening = array();
foreach ($uris as $uri) {
    $name[$uri['s']] = $uri['l'];
    $icon[$uri['s']] = $uri['i'];
    getTimes($uri);
}
$dfrom = mktime(0, 0, 0, 1, 1, 2011);
$dto = mktime(0, 0, 0, 1, 1, 2013);
$nowdate = date('Y/m/d', $now);
foreach ($uris as $uri) {
    if ($uri['s'] == 'http://id.southampton.ac.uk/point-of-service/42-cafe') {
        continue;
    }
    //echo $uri['l']."<br />";
    $po = $opening[$uri['s']];
    $pno = $noopening[$uri['s']];
    $tprevopen = null;
    $tnextopen = null;
    for ($i = $dfrom; $i < $dto; $i += 60 * 60 * 24) {
        $idate = date('Y/m/d', $i);
예제 #7
0
require "logic.php";
if (isset($_GET["name_id"])) {
    $result = checkin($_GET["name_id"]);
} else {
    if (isset($_GET["id"])) {
        $result = checkout($_GET["id"]);
    }
}
$result = getNames();
$time_add = array();
$start = array();
$end = array();
$flag = array();
$ids = array();
while ($row = mysql_fetch_assoc($result)) {
    $time_result = getTimes($row["id"]);
    $time_add[$row["name"]] = 0;
    $flag[$row["name"]] = 0;
    $ids[$row["name"]] = $row["id"];
    while ($time_row = mysql_fetch_assoc($time_result)) {
        if ($time_row["end"] === NULL) {
            $flag[$row["name"]] = $time_row["id"];
            $start[$row["name"]] = date('Y-m-d H:i:s', strtotime($time_row["start"]));
        } else {
            $end[$row["name"]] = $time_row["end"];
            //秒数の計算
            $time_start = strtotime($time_row["start"]);
            $time_end = strtotime($time_row["end"]);
            $time_add[$row["name"]] += abs($time_end - $time_start);
        }
    }