public function get_web_log() { //select the database mssql_select_db($this->dbname, $this->dbcon); //SQL Select statement $xml = new XMLHandler(XML_DIR . "web_request_spk.xml"); $sql_from_xml = $xml->getNode("web_log"); $sqlselect = str_replace("FILTER_BY_PROGRAM", "", $sql_from_xml); //Run the SQL query $result = mssql_query($sqlselect); $numfields = mssql_num_fields($result); $string_result = ""; while ($row = mssql_fetch_row($result)) { $string_result .= "<tr>"; for ($i = 0; $i < $numfields; $i++) { if (mssql_field_name($result, $i) == "IP_ADDRESS") { $ip = explode(":", $row[$i]); $string_result .= "<td>" . $ip[0] . "</td>"; $string_result .= "<td>" . $ip[1] . "</td>"; } else { $string_result .= "<td>" . $row[$i] . "</td>"; } } $string_result .= "</tr>"; } return $string_result; }
public function render_user_menu($userid) { try { //select the database mssql_select_db($this->dbname, $this->dbcon); //SQL Select statement $xml = new XMLHandler(XML_DIR . "web_request_global.xml"); $sql_from_xml = $xml->getNode("selectedmenu"); $sqlselect = str_replace("FILTER_BY_PROGRAM", " WHERE USERID='{$userid}' ", $sql_from_xml); //Run the SQL query $sqlquery = mssql_query($sqlselect); $string_result = ""; $createChild = false; while ($result = mssql_fetch_array($sqlquery)) { if ($result["HAS_CHILD"] == "1") { if ($createChild) { $string_result .= '</ul>'; $string_result .= '</li>'; } $string_result .= '<li class="treeview{activeclass}">'; $string_result .= ' <a href="#"><i class="' . $result["MENU_CLASS"] . '"></i> <span>' . $result["MENU_DESCRIPTION"] . '</span> <i class="fa fa-angle-left pull-right"></i></a>'; $string_result .= ' <ul class="treeview-menu">'; $createChild = true; } else { $aciveclass = ""; $aciveclassforparent = ""; if ($result["URL_TARGET"] == $_GET['app']) { $aciveclass = ' class="active"'; $aciveclassforparent = " active"; } $string_result = str_replace("{activeclass}", $aciveclassforparent, $string_result); $string_result .= '<li' . $aciveclass . '><a href="' . $result["URL_TARGET"] . '"><i class="' . $result["MENU_CLASS"] . '"></i>' . $result["MENU_DESCRIPTION"] . '</a></li>'; } } if ($createChild) { $string_result .= '</ul>'; $string_result .= '</li>'; } return $string_result; } catch (Exception $e) { throw new Exception($e->getMessage()); } }
public function get_unit_rfs() { //select the database mssql_select_db($this->dbname, $this->dbcon); //SQL Select statement $xml = new XMLHandler(XML_DIR . "web_request_spk.xml"); $sql_from_xml = $xml->getNode("rfs"); $sqlselect = str_replace("FILTER_BY_PROGRAM", "", $sql_from_xml); //Run the SQL query $result = mssql_query($sqlselect); $numfields = mssql_num_fields($result); $string_result = ""; while ($row = mssql_fetch_row($result)) { $string_result .= "<tr>"; for ($i = 0; $i < $numfields; $i++) { $string_result .= "<td>" . $row[$i] . "</td>"; } $string_result .= "</tr>"; } return $string_result; }
public function salesstatistik_summary($filterby) { //select the database mssql_select_db($this->dbname, $this->dbcon); //SQL Select statement $xml = new XMLHandler(XML_DIR . "web_request_spk.xml"); $sql_from_xml = $xml->getNode("salesstatistik_summary"); $sqlselect = str_replace("FILTER_BY_PROGRAM", "year(getdate()),'" . $_SESSION["user-ws"] . "'", $sql_from_xml); $sqlselect = $sqlselect . " WHERE TIPE='" . $filterby . "' "; //Run the SQL query $result = mssql_query($sqlselect); //$numfields = mssql_num_fields($result); $jsonString = "["; $fieldsCollection = ""; $counter = 0; while ($row = mssql_fetch_row($result)) { if ($fieldsCollection != "") { $fieldsCollection .= ","; } $fieldsCollection .= (string) $row[2]; $counter++; } for ($i = $counter; $i < 6; $i++) { if ($fieldsCollection != "") { $fieldsCollection .= ","; } $fieldsCollection .= 0; } $jsonString .= $fieldsCollection . "]"; return $jsonString; }
public function count_activetrans($criteria) { //select the database mssql_select_db($this->dbname, $this->dbcon); //SQL Select statement $xml = new XMLHandler(XML_DIR . "test.xml"); $sql_from_xml = $xml->getNode("count_active_trans"); $sqlselect = str_replace("FILTER_BY_PROGRAM", " AND SESSION_ID = '" . $criteria . "' ", $sql_from_xml); //Run the SQL query $sqlquery = mssql_query($sqlselect); $string_result = ""; while ($result = mssql_fetch_array($sqlquery)) { $string_result = $result["BARCODE_COUNT"]; } return $string_result; }
public function outstanding_po() { //select the database mssql_select_db($this->dbname, $this->dbcon); //SQL Select statement $xml = new XMLHandler(XML_DIR . "web_request_spk.xml"); $sql_from_xml = $xml->getNode("outstanding_po"); $sqlselect = str_replace("FILTER_BY_PROGRAM", "", $sql_from_xml); //Run the SQL query $result = mssql_query($sqlselect); $numfields = mssql_num_fields($result); $string_result = "<table class=\"table table-hover\"><thead><tr>"; $string_result = ""; $string_result .= "<div class=\"box\">"; $string_result .= "\t<div class=\"box-header\">"; $string_result .= " <h3 class=\"box-title\">Current Outstanding PO</h3>"; $string_result .= " </div><!-- /.box-header -->"; $string_result .= " <div class=\"box-body\">"; $string_result .= " <table id=\"example1\" class=\"table table-bordered table-striped\">"; $string_result .= " <thead>"; $string_result .= " <tr>"; for ($i = 0; $i < $numfields; $i++) { $string_result .= "<th>" . mssql_field_name($result, $i) . "</th>"; } $string_result .= " </tr>"; $string_result .= " </thead>"; $string_result .= " <tbody>"; while ($row = mssql_fetch_row($result)) { $string_result .= "<tr>"; for ($i = 0; $i < $numfields; $i++) { if ($i == 0) { $string_result .= "<th scope=\"row\"><a href=\"loadpo_" . $row[$i] . "\">" . $row[$i] . "</a></th>"; } else { $string_result .= "<td>" . $row[$i] . "</td>"; } } $string_result .= "</tr>"; } $string_result .= "\t\t\t </tbody>"; $string_result .= "\t\t </table>"; $string_result .= " </div><!-- /.box-body -->"; $string_result .= " </div><!-- /.box -->"; return $string_result; }
public function run_inquirydetail($criteria) { //select the database mssql_select_db($this->dbname, $this->dbcon); //SQL Select statement $xml = new XMLHandler(XML_DIR . "inquiry.xml"); $sql_from_xml = $xml->getNode("inquiry"); $sqlselect = str_replace("FILTER_BY_PROGRAM", " WHERE SPK.NO_SPK = '" . $criteria . "' ", $sql_from_xml); //Run the SQL query $result = mssql_query($sqlselect); $numfields = mssql_num_fields($result); $string_result = ""; while ($row = mssql_fetch_row($result)) { for ($i = 0; $i < $numfields; $i++) { $fieldType = mssql_field_type($result, $i); if ($fieldType == "datetime") { if ($row[$i] != null) { $dateVal = strtotime($row[$i]); $string_result .= "<tr><th scope=\"row\">" . mssql_field_name($result, $i) . "</th><td>:</td><td>" . date('d-m-Y', $dateVal) . "</td></tr>"; } else { $string_result .= "<tr><th scope=\"row\">" . mssql_field_name($result, $i) . "</th><td>:</td><td>-</td></tr>"; } } else { if ($i == 0) { $string_result .= "<tr><th scope=\"row\">" . mssql_field_name($result, $i) . "</th><td>:</td><td>" . $row[$i] . " <a href='loadspk_" . $criteria . "'><button type=\"button\" class=\"btn btn-info btn-xs\">edit</button></a></td></tr>"; } else { $string_result .= "<tr><th scope=\"row\">" . mssql_field_name($result, $i) . "</th><td>:</td><td>" . $row[$i] . "</td></tr>"; } } } } $string_result .= "<tr><th scope=\"row\" colspan=3><a href='loadspk_" . $criteria . "'><button type=\"button\" class=\"btn btn-info\">edit mode</button></a></th></tr>"; return $string_result; }