function runSQL($s_sql) { $o_conn = mysql_connect($this->server, $this->userName, $this->password); if (!$o_conn) { die_well(mysql_error()); } $o_sel = mysql_select_db($this->db); if (!$o_sel) { die_well(mysql_error()); } return mysql_query($s_sql); }
function getData($s_sql) { $s_server = "65.175.107.2:3306"; $s_userName = "******"; $s_password = "******"; $s_db = "braddoro"; $o_conn = mysql_connect($s_server, $s_userName, $s_password); if (!$o_conn) { die_well(mysql_error()); } $o_sel = mysql_select_db($s_db); if (!$o_sel) { die_well(mysql_error()); } return mysql_query($s_sql); }
function row_input_select($s_fieldName, $s_sql, $i_selected, $left_class = "", $right_class = "", $s_fieldString = "") { $s_string = '<tr>'; $s_string .= '<td class="' . $left_class . '">' . $s_fieldString . '</td>'; $s_string .= '<td class="' . $right_class . '">'; $q_select = mysql_query($s_sql); if (!$q_select) { die_well(__LINE__, mysql_error()); } $s_string .= '<select id="' . $s_fieldName . '" name="' . $s_fieldName . '" class="fields">'; //$s_string .= '<option value="0"></option>'; while ($rowSelect = mysql_fetch_row($q_select)) { if ($rowSelect[0] == $i_selected) { $s_selected = " SELECTED"; } else { $s_selected = ""; } $s_string .= '<option value="' . $rowSelect[0] . '"' . $s_selected . '>' . $rowSelect[1] . '</option>'; } $s_string .= "</select>"; $s_string .= '</td>'; $s_string .= '</tr>'; return $s_string; }
echo '<img src="../../images/Button-Pause-16x16.png" border="0" height="12" width="12" title="Edit">'; echo '</a></td>'; for ($f = 0; $f < $i_fields; $f++) { echo '<td class="' . $s_class . '">' . $rowData[$f] . '</td>'; } echo '</tr>'; $i_currRow++; } break; case "edit": echo $s_header; $page_task = "save"; $s_sql = 'select projectID, project, active from cms.cfg_projects where projectID = ' . $i_projectID . ';'; $q_data = mysql_query($s_sql); if (!$q_data) { die_well(__LINE__, mysql_error()); } while ($rowData = mysql_fetch_row($q_data)) { $i_projectID = $rowData[0]; $s_project = $rowData[1]; $i_active = $rowData[2]; } echo '<a href="' . $s_fileName . '" target="_top"><img src="../../images/Button-Info-16x16.png" border="0" height="12" width="12" title="List"></a>'; echo '<form id="frmForm" name="frmForm" action="' . $s_fileName . '" method="post">'; echo '<input type="hidden" name="page_task" id="page_task" value="' . $page_task . '">'; echo '<table style="border-collapse: collapse;">' . $g_break; echo row_input_text($s_fieldName = "projectID", $i_fieldSize = 5, $s_data = $i_projectID, $left_class = "odd", $right_class = "even", $s_fieldString = "Project ID", $use_input = 0, $use_hidden = 1, $value_only = 1) . $g_break; echo row_input_text($s_fieldName = "projectCode", $i_fieldSize = 10, $s_data = trim($s_projectCode), $left_class = "odd", $right_class = "even", $s_fieldString = "Project Code") . $g_break; echo row_input_text($s_fieldName = "project", $i_fieldSize = 30, $s_data = trim($s_project), $left_class = "odd", $right_class = "even", $s_fieldString = "Project") . $g_break; echo row_input_text($s_fieldName = "active", $i_fieldSize = 5, $s_data = $i_active, $left_class = "odd", $right_class = "even", $s_fieldString = "Active") . $g_break; if ($i_projectID > 0) {
if ($_POST["EmployeeList"] == odbc_result($rs, "EmployeeID")) { echo " SELECTED"; } } echo ">" . odbc_result($rs, "FullName") . "</option>" . $g_break; } echo "</select>"; odbc_close($conn); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='sideheader'>Work Performed</td>"; echo "<td class='formright'>"; $sql = "usp_Select_ContractTasks " . $ContractID; $conn = odbc_connect($ini_array["DSN"], $ini_array["UN"], $ini_array["PWD"]); $rs = odbc_exec($conn, $sql) or die_well(__FILE__, __LINE__, odbc_errormsg()); $rows = 0; echo "<table class='table1'>" . $g_break; while ($row = odbc_fetch_array($rs)) { if (fmod($rows, 2) == 0) { echo "<tr class='even'>" . $g_break; } else { echo "<tr class='odd'>" . $g_break; } echo "<td>"; echo $row['Task']; echo "</td>"; echo "<td>"; echo "<input type='text' name='MID_" . $row['MaintenanceTaskID'] . "' id='MID_" . $row['MaintenanceTaskID'] . "' size='3' maxlength='3'>"; echo " "; if ($row['MinutesToComplete'] != 0) {
if (!$o_conn) { die_well(mysql_error()); } $o_sel = mysql_select_db($s_db); if (!$o_sel) { die_well(mysql_error()); } if (isset($_POST['chapterID'])) { $i_chapterID = intval($_POST['chapterID']); } else { $i_chapterID = 0; } $s_sql = "select \t\r\n\t headingID, displayOrder, headingName\r\n\tfrom \r\n\t cms.cfg_howto_headings\r\n\tWHERE \r\n\t chapterID = {$i_chapterID} \r\n\torder by \r\n \tdisplayOrder, headingName"; $q_data = mysql_query($s_sql); if (!$q_data) { die_well(mysql_error()); } $s_headingText = ''; if (mysql_num_rows($q_data)) { $s_headingText = '<select id="headingID" name="headingID">' . "\n"; while ($rowData = mysql_fetch_row($q_data)) { $s_headingText .= '<option value="' . $rowData[0] . '">' . $rowData[1] . '. ' . $rowData[2] . '</option>' . "\n"; } $s_headingText .= '</select>' . "\n"; } else { $s_headingText .= '<input type="hidden" id="headingID" name="headingID" value="0">' . "\n"; } $s_html = $s_headingText; break; case "saveContent": $i_howtoID = intval(set_var("howtoID", 0));
} echo "</table>"; odbc_close($conn); echo "<br>" . $g_break; //--------------------------------------------------------------------------------------------- // Client numbers display. //--------------------------------------------------------------------------------------------- echo "<form action='clients.php' method='post' name='addnumber' id='addnumber'>" . $g_break; echo "<input type='hidden' name='ClientID' id='ClientID' value='" . $ClientID . "'>" . $g_break; echo "<table class='table1'>" . $g_break; echo "<tr>"; echo "<td class='sideheader'>Number Type</td>"; echo "<td class='formright'>"; $sql2 = "usp_select_NumberTypes"; $conn2 = odbc_connect($ini_array["DSN"], $ini_array["UN"], $ini_array["PWD"]); $rs2 = odbc_exec($conn2, $sql2) or die_well(__FILE__, __LINE__, odbc_errormsg()); echo "<select name='NumberTypeID' id='NumberTypeID'>" . $g_break; echo "<option value='0'></option>"; while ($row2 = odbc_fetch_array($rs2)) { echo "<option value='" . $row2['NumberTypeID'] . "'"; if ($row['NumberTypeID'] == $row2['NumberTypeID']) { echo " SELECTED"; } echo ">" . $row2['NumberType'] . "</option>" . $g_break; } odbc_close($conn); echo "</td>"; echo "</tr>" . $g_break; echo "<tr>"; echo "<td class='sideheader'>Number</td>"; echo "<td class='formright'><input type='text' name='Number' id='Number' size='50' maxlength='50'></td>";
echo '<td class="title" valign="top">Date:</td>'; echo '<td class="header" valign="top">' . date('m/d/Y') . '</td>'; echo '</tr>' . $g_break; echo '</table>' . $g_break; echo '<br />' . $g_break; $s_sql = 'select yearweek(T.actionDateTime,0) as "week", T.actionDateTime, T.duration, T.miles, P.project, A.timeType, T.action, T.description from cms.log_timetrack T inner join cms.cfg_projects P on T.projectID = P.projectID inner join cms.cfg_time_types A on A.timeTypeID = T.timeTypeID where yearweek(T.actionDateTime,0) = ' . $s_week . ' order by T.actionDateTime, P.project;'; $q_data = mysql_query($s_sql); if (!$q_data) { die_well(__LINE__, mysql_error(), $s_sql); } echo '<table border="0" style="border-collapse: collapse;">'; echo '<tr>'; echo '<th class="accentrow">Date Time</th>'; echo '<th class="accentrow" align="right">Minutes</th>'; echo '<th class="accentrow" align="right">Miles</th>'; echo '<th class="accentrow">Project</th>'; echo '<th class="accentrow" colspan="2">Detail</th>'; echo '</tr>'; $i_totalRows = 7; $i_currRow = 0; $i_totalTime = 0; while ($rowData = mysql_fetch_row($q_data)) { if ($i_currRow % 2) { $s_class = "odd";
if ($i_sort == 8) { $s_sort = "median"; } if ($i_sort == 9) { $s_sort = "regionType"; } if ($i_dir == 1) { $s_dir = "asc"; } else { $s_dir = "desc"; } echo '<table style="border-collapse:collapse;">' . $g_break; $s_sql = "select M.regionName, M.itemName, M.volume, M.avg, M.min, M.max, M.stddev, M.median, R.regionType \r\n\tFROM braddoro.cfg_eve_market_region M \r\n\tinner join braddoro.cfg_eve_regions R\r\n\ton M.regionID = R.regionID\r\n\torder by " . $s_sort . " " . $s_dir . ";"; $q_data = mysql_query($s_sql); if (!$q_data) { die_well(mysql_error(), $s_sql); } if (mysql_num_rows($q_data) > 0) { echo '<tr>' . $g_break; echo '<th class="celll">Region <img src="../../images/down.gif" onclick="js_sort(1,1);" title="Sort Ascending" style="cursor:pointer;"><img src="../../images/up.gif" onclick="js_sort(1,2);" title="Sort Descending" style="cursor:pointer;"></th>' . $g_break; echo '<th class="celll">Item <img src="../../images/down.gif" onclick="js_sort(2,1);" title="Sort Ascending" style="cursor:pointer;"><img src="../../images/up.gif" onclick="js_sort(2,2);" title="Sort Descending" style="cursor:pointer;"></th>' . $g_break; echo '<th class="cellr">Volume <img src="../../images/down.gif" onclick="js_sort(3,1);" title="Sort Ascending" style="cursor:pointer;"><img src="../../images/up.gif" onclick="js_sort(3,2);" title="Sort Descending" style="cursor:pointer;"></th>' . $g_break; echo '<th class="cellr">Average <img src="../../images/down.gif" onclick="js_sort(4,1);" title="Sort Ascending" style="cursor:pointer;"><img src="../../images/up.gif" onclick="js_sort(4,2);" title="Sort Descending" style="cursor:pointer;"></th>' . $g_break; echo '<th class="cellr">Minimum <img src="../../images/down.gif" onclick="js_sort(5,1);" title="Sort Ascending" style="cursor:pointer;"><img src="../../images/up.gif" onclick="js_sort(5,2);" title="Sort Descending" style="cursor:pointer;"></th>' . $g_break; echo '<th class="cellr">Maximum <img src="../../images/down.gif" onclick="js_sort(6,1);" title="Sort Ascending" style="cursor:pointer;"><img src="../../images/up.gif" onclick="js_sort(6,2);" title="Sort Descending" style="cursor:pointer;"></th>' . $g_break; echo '<th class="cellr">Std. Dev. <img src="../../images/down.gif" onclick="js_sort(7,1);" title="Sort Ascending" style="cursor:pointer;"><img src="../../images/up.gif" onclick="js_sort(7,2);" title="Sort Descending" style="cursor:pointer;"></th>' . $g_break; echo '<th class="cellr">Median <img src="../../images/down.gif" onclick="js_sort(8,1);" title="Sort Ascending" style="cursor:pointer;"><img src="../../images/up.gif" onclick="js_sort(8,2);" title="Sort Descending" style="cursor:pointer;"></th>' . $g_break; echo '<th class="cellr">Region Type <img src="../../images/down.gif" onclick="js_sort(9,1);" title="Sort Ascending" style="cursor:pointer;"><img src="../../images/up.gif" onclick="js_sort(9,2);" title="Sort Descending" style="cursor:pointer;"></th>' . $g_break; echo '<th class="cellr">monthly Income</th>' . $g_break; echo '</tr>' . $g_break; }