Ejemplo n.º 1
0
<?php

require_once 'sp-bootstrap.php';
$bootstrap->isLoggedIn();
site_header('time');
$get_page = $_SERVER['PHP_SELF'];
$type = 'time_entries';
$last_week = last_week_range();
if ($_GET['from-date']) {
    $from_date = date('Y-m-d', strtotime($_GET['from-date']));
}
if ($_GET['to-date']) {
    $to_date = date('Y-m-d', strtotime($_GET['to-date']));
}
if ($_GET['from-date'] || $_GET['to-date']) {
    $date_range_get_params = '&from-date=' . $from_date . '&to-date=' . $to_date;
}
?>
<script type="text/javascript">

$(document).on('pageshow', 'div[data-role*="page"],div[data-role*="dialog"]', function () {
		 (function () {
			var script = document.createElement('script'); script.type = 'text/javascript'; script.async = true;
			script.src = 'js/jquery.datepicker.custom.js';
			var three = document.getElementsByTagName('script')[0]; three.parentNode.insertBefore(script, three);
		})();
	});
$(document).ready(function(){
	
$('#perdiam').val($('#perdiam-select').val());
	$('#time_type').val($('#time_type-select').val());
    public function get_submitter_by_jobid($job_id)
    {
        $last_week = last_week_range('Y-m-d');
        include 'db.config.php';
        $mysqli = new mysqli($operations_dbhost, $operations_dbuser, $operations_dbpass, $operations_dbname);
        /* check connection */
        if (mysqli_connect_errno()) {
            printf("Connect failed: %s\n", mysqli_connect_error());
            exit;
        }
        $query = 'SELECT te.submitter_id, u.firstname, u.lastname
				FROM ' . $system_dbname . '.time_entries te
				JOIN user u
				ON te.submitter_id = u.id
				WHERE job_id = "' . $job_id . '"
				ORDER BY te.id DESC
				LIMIT 0,1';
        $result = $mysqli->query($query);
        $x = 0;
        while ($row = $result->fetch_assoc()) {
            $data = $row;
            //$submitter_fullname = trim(ucfirst(strtolower($row['firstname']))).' '. trim(ucfirst(strtolower($row['lastname'])));
        }
        $mysqli->close();
        return $data;
    }