示例#1
0
         echo "<input type=hidden name='query_id' value='{$query_id}'>\n";
         echo "<input type=hidden name='query' value='{$query}'>\n";
         echo "<input type='hidden' name='database' value='{$database}'>\n";
         for ($i = 0; $i < 10; ++$i) {
             echo "<input type='hidden' name='eid_{$i}' value='" . $GLOBALS["eid_{$i}"] . "'>\n";
         }
         echo "<input type='hidden' name='string' value='{$string}'>\n";
         echo "<input type='hidden' name='start_date' value='{$start_date}'>\n";
         echo "<input type='hidden' name='end_date' value='{$end_date}'>\n";
         echo "</form>\n";
     } else {
         echo "<b>Query '{$query}' failed</b>: '{$result}'<br>\n";
     }
 } else {
     if ($refresh_result && isset($query_id) && $selectedLAS['address']) {
         $success = getQueryResult($selectedLAS['address'], $query_id, $result, $page, $numpages);
         echo "<br><br>";
         if ($success) {
             echo "<b>Query '{$query}' result</b>:<br>\n";
             echo "<b>";
             $refstr = $_SERVER['PHP_SELF'] . "?refresh_result=1&las_address=" . $selectedLAS['address'] . "&query_id={$query_id}&query={$query}&database={$database}&string={$string}&start_date={$start_date}&end_date={$end_date}";
             for ($i = 0; $i < 10; ++$i) {
                 if ($GLOBALS["eid_{$i}"] != '') {
                     $refstr .= "&eid_{$i}=" . $GLOBALS["eid_{$i}"];
                 }
             }
             if ($page > 0) {
                 echo "<a href='{$refstr}&page=0'>&lt;&lt;</a>\n ";
             } else {
                 echo "&lt;&lt; ";
             }
 private function getShiftTimes()
 {
     if (!empty($this->shiftTimeID)) {
         $myq = getShiftsByID($this->config, $this->shiftTimeID);
         $result = getQueryResult($this->config, $myq, $debug = false);
         $row = $result->fetch_assoc();
         $this->shiftStart = $row['BEG_TIME'];
         $this->shiftEnd = $row['END_TIME'];
         if (strtotime($this->shiftStart) > strtotime($this->shiftEnd)) {
             //This time crosses past midnight
             $this->filters .= getReqestsPastMidightTimes($this->shiftStart, $this->shiftEnd);
         } else {
             $this->filters .= getReqestsBetweenTimes($this->shiftStart, $this->shiftEnd);
         }
     }
 }
示例#3
0
<?php

$listqry = " SELECT \r\n\t\t\t\tA.seq,\r\n\t\t\t\tA.ip,\r\n\t\t\t\tA.port,\r\n\t\t\t\tA.id,\r\n\t\t\t\tA.pw,\r\n\t\t\t\tA.title,  \r\n\t\t\t\tA.useyn,\r\n\t\t\t\tA.wdate\r\n\t\t\t FROM TB_SVRLIST AS A\r\n\t\t\t WHERE delyn = 'N'\r\n\t\t     ORDER BY A.seq";
$svrlist = getQueryResult($listqry);
?>
<div class="content_wrap">
	<nav id="list_nav">
	  	<div class="fr">
	  		<form action="/index.php" method="get" class="form-horizontal" role="form">
			  	<button type="button" id="make_svrlist" class="fl ml5 btn btn-success btn-sm" data-toggle="modal" data-target="#svr_form" onclick="formInit()">서버 추가</button>
		  	</form>
		</div>
	</nav>
	
	<table id="ql" class="table table-striped table-bordered table-hover" cellspacing="0">
        <thead>
            <tr class="linear">
            	<th>번호</th>
                <th>상태</th>
                <th>서버명</th>
                <th>HOST IP</th>
                <th>PORT</th>
                <th>FTP ID</th>
                <th>FTP PW</th>
                <th>등록일</th>
            </tr>
        </thead>
        <tbody>
        	<?php 
$no = 1;
foreach ($svrlist as $k => $v) {
示例#4
0
 public function getHRTimeRequestCountsByEmp()
 {
     $myq = "SELECT REFER 'RefNo', REQ.MUNIS 'Munis', \r\n                    CONCAT_WS(', ',REQ.LNAME,REQ.FNAME) 'Name', REQ.IDNUM 'EMP_ID',\r\n                    COUNT(REFER) as 'ReqNumbers'\r\n                FROM REQUEST\r\n                LEFT JOIN EMPLOYEE AS REQ ON REQ.IDNUM=REQUEST.IDNUM\r\n                LEFT JOIN EMPLOYEE AS APR ON APR.IDNUM=REQUEST.APPROVEDBY\r\n                LEFT JOIN EMPLOYEE AS HR ON HR.IDNUM=REQUEST.HRAPP_ID\r\n                LEFT JOIN TIMETYPE AS OLDT ON OLDT.TIMETYPEID = REQUEST.TIMETYPEID\r\n                LEFT JOIN SUBTYPE AS OLDSUB ON OLDSUB.IDNUM=REQUEST.SUBTYPE\r\n                LEFT JOIN WTS_TIMETYPES AS T ON T.IDNUM=REQUEST.TIMETYPES_ID\r\n                LEFT JOIN WTS_SUBTIMETYPES AS SUB ON SUB.IDNUM=REQUEST.SUBTYPE_ID\r\n                WHERE 1 " . $this->filters . "\r\n                GROUP BY REQ.IDNUM\r\n                ORDER BY 'Name'";
     $result = getQueryResult($this->config, $myq, $debug = false);
     return $result;
 }
示例#5
0
         $stmt = mysqli_prepare($dbconn, "UPDATE TB_ADS SET useyn = ?, category = ?, title = ?, udate = CURRENT_TIMESTAMP WHERE seq = ?");
         $bind = mysqli_stmt_bind_param($stmt, "sisi", $grp_useyn, $grp_category, $grp_title, $grp_seq);
         $exec = mysqli_stmt_execute($stmt);
         mysqli_stmt_close($stmt);
     }
     $xml = "<root>";
     $xml .= "<result>" . ($exec ? "SUCCESS" : "FAIL") . "</result>";
     $xml .= "</root>";
     break;
 case "ads_list":
     $seq = filter_input(INPUT_POST, 'seq');
     $qr = getQueryResult("SELECT useyn,category,title FROM TB_ADS WHERE delyn = 'N' AND seq = '" . $seq . "' limit 1");
     $grp_useyn = $qr[0]['useyn'];
     $grp_category = $qr[0]['category'];
     $grp_title = $qr[0]['title'];
     $qr = getQueryResult("SELECT seq,useyn,ratio,title,sdate,edate,width,height,script FROM TB_SCRIPTS WHERE delyn = 'N' AND ref = '" . $seq . "'");
     $xml = "<root>";
     $xml .= "<grp_useyn>" . $grp_useyn . "</grp_useyn>";
     $xml .= "<grp_category>" . $grp_category . "</grp_category>";
     $xml .= "<grp_title>" . $grp_title . "</grp_title>";
     foreach ($qr as $k => $v) {
         $xml .= "<item>";
         $xml .= "\t<seq>" . $v['seq'] . "</seq>";
         $xml .= "\t<useyn><![CDATA[" . $v['useyn'] . "]]></useyn>";
         $xml .= "\t<ratio><![CDATA[" . $v['ratio'] . "]]></ratio>";
         $xml .= "\t<title><![CDATA[" . $v['title'] . "]]></title>";
         $xml .= "\t<sdate><![CDATA[" . $v['sdate'] . "]]></sdate>";
         $xml .= "\t<edate><![CDATA[" . $v['edate'] . "]]></edate>";
         $xml .= "\t<width><![CDATA[" . $v['width'] . "]]></width>";
         $xml .= "\t<height><![CDATA[" . $v['height'] . "]]></height>";
         $xml .= "\t<script><![CDATA[" . $v['script'] . "]]></script>";
示例#6
0
 private function getLastPayPeriodEnd()
 {
     //what pay period are we currently in?
     $myq = getCurrentPayPeriod();
     $result = getQueryResult($this->config, $myq, $debug = false);
     $ppArray = $result->fetch_assoc();
     $startDate = $ppArray['PPBEG'];
     $this->lastPayStart = date('Y-m-d', strtotime('-14 days', strtotime($startDate)));
     $endDate = $ppArray['PPEND'];
     $this->lastPayEnd = date('Y-m-d', strtotime('-14 days', strtotime($endDate)));
     return $endDate;
 }
示例#7
0
function showSelectDivision($config, $myDivID, $table = "R.")
{
    if ($config->adminLvl >= 0) {
        echo '<div align="center">Show for the following division: 
            <select name="divisionID" onchange="this.form.submit()">';
        if (isset($_POST['divisionID'])) {
            $myDivID = $_POST['divisionID'];
        } else {
            if ($config->adminLvl >= 50) {
                $myDivID = "All";
            } else {
                $mydivq = "SELECT DIVISIONID FROM EMPLOYEE E WHERE E.IDNUM='" . $config->mysqli->real_escape_string($_SESSION['userIDnum']) . "'";
                $myDivResult = getQueryResult($config, $mydivq, $debug = false);
                $temp = $myDivResult->fetch_assoc();
                $myDivID = $temp['DIVISIONID'];
            }
        }
        $alldivq = "SELECT * FROM `DIVISION`";
        $allDivResult = getQueryResult($config, $alldivq, $debug = false);
        while ($Divrow = $allDivResult->fetch_assoc()) {
            echo '<option value="' . $Divrow['DIVISIONID'] . '"';
            if ($Divrow['DIVISIONID'] == $myDivID) {
                echo ' SELECTED ';
            }
            echo '>' . $Divrow['DESCR'] . '</option>';
        }
        if ($config->adminLvl >= 25) {
            if (strcmp($myDivID, "All") == 0) {
                echo '<option value="All" SELECTED>All</option>';
            } else {
                echo '<option value="All">All</option>';
            }
        }
        echo '</select><br/><br/>';
        //            if ($myDivID != "All")
        //                $this->showShiftDropDown($myDivID, $onChangeSubmit = true);
        echo '</div>';
        $filters = getFilerDivision($config, $myDivID, $table);
        //popupmessage($filters);
        return $filters;
    }
}
示例#8
0
function getCharacters($mysqli)
{
    return getQueryResult($mysqli, 'SELECT * FROM characters');
}
示例#9
0
if ($scale != "remove") {
    $total_page = ceil($total_record / $scale);
    $first = $scale * ($page - 1);
    $no = $total_record - $first + 1;
    $total_block = ceil($total_page / 5);
    $block = ceil($page / 5);
    $first_page = ($block - 1) * 5;
    $last_page = $total_block <= $block ? $total_page : $block * 5;
    $prev = $first_page;
    $next = $last_page + 1;
    $go_page = $first_page + 1;
} else {
    $no = $total_record + 1;
}
$limit = $scale != "remove" ? ' limit ' . $first . ', ' . $scale : "";
$adslist = getQueryResult($listqry . $limit);
?>
<div class="content_wrap">
	<nav id="list_nav">
	  	<select class="form-control" name="pageselect">
		    <option <?php 
echo $scale == 15 ? "selected='selected'" : "";
?>
 value="15">15</option>
		    <option <?php 
echo $scale == 50 ? "selected='selected'" : "";
?>
 value="50">50</option>
		    <option <?php 
echo $scale == 100 ? "selected='selected'" : "";
?>
示例#10
0
 public function showTimeRequestEmpCounts($config, $filters, $orderBy = "ORDER BY REFER DESC", $hiddenInput = '')
 {
     echo '<input type="hidden" name="formName" value="submittedRequests" />';
     $this->config = $config;
     $this->currentFilters = $filters;
     $this->hiddenInput = $hiddenInput;
     $this->handlePOSTVariables();
     if ($this->isShowTable) {
         if ($this->config->adminLvl < 25) {
             //users only allowed to view own reference numbers
             $this->currentFilters = getFilterLoggedInUserRequestID($this->config);
         }
         $this->currentLimit = $this->getCurrentPageLimits();
         $this->currentQuery = getTimeRequestTable($this->config, $this->currentFilters, $orderBy, $this->currentLimit);
         $this->showPageLimitOptions();
         $this->showSortingOptions();
     }
     $result = getQueryResult($this->config, $this->currentQuery, $this->debug);
     return $result;
 }