function hours_send(&$state, &$HTML) { if ($state->row == 0) { //0 is add row $state->extension = ""; $maxcol = $state->max_column; } else { log_list($state); //get row specific stuff foreach ($state->records as $recID => $record) { if ($record["row"] == $state->row) { break; } array_shift($state->records); } $state->extension = $record["extension"]; $maxcol = $record["max_column"]; } $rates = active_rates($state->project_id); $offset = 0; if ($state->columns > 0) { $offset = $state->closedCols; } //tabular style for ($offset = $offset; $offset <= $maxcol; ++$offset) { $cellID = "HR_" . $state->row . "_" . $offset; $HTML .= "//next Hours " . $offset . "...\n"; $HTML .= "cell = document.getElementById('" . $cellID . "');\n"; $HTML .= "cellValue = cell.innerHTML;\n"; if ($rates[$offset] == 0) { //no hourly rate so no input $HTML .= "fill = \"<div name='txtHours" . $offset . "' id='txtHours" . $offset . "_ID'>"; $HTML .= "Rate not available</div>\";\n"; } else { $HTML .= "fill = \"<input type='text' name='txtHours" . $offset . "' id='txtHours" . $offset . "_ID' size='3'"; $HTML .= " maxlength='6' class='number' onblur='audit_hours(this)' value='\"+cellValue+\"'>\";\n"; if ($state->extension != "") { $HTML .= "if (cellValue != 0) {\n"; $HTML .= " fill += \"<br><img src='" . $_SESSION["_SITE_CONF"]["_REDIRECT"] . "/images/extension.png'"; $conf = parse_ini_file($_SESSION["_SITE_CONF"]["_EXTENSIONS"] . $state->extension . "_conf.php"); $HTML .= " title='click for " . $conf["title"] . "'"; $HTML .= " onclick = 'return extension(get_cell_recid(\\\"" . $cellID . "\\\")," . $conf["width"] . "," . $conf["height"] . ")'>\";\n"; $HTML .= "}\n"; } } $HTML .= "if (cell.getAttribute('data-recid') >= 0) {\n"; $HTML .= " cell.innerHTML = fill;\n"; $HTML .= "}\n"; } }
function hours_send(&$state, &$HTML) { global $_VERSION; if ($state->mode == "l") { //list style ; only one hour field $offset = 0; $maxcol = 1; } else { //tabular style $offset = $state->columns[COL_OPEN]; $maxcol = $state->columns[COL_INACTIVE]; if ($state->row == 0) { //0 is add row $state->extension = ""; } else { log_list($state, $state->row); //find row specific stuff $record = reset($state->records); $state->extension = $record["extension"]; } } $rates = active_rates($state->project_id); for ($offset = $offset; $offset < $maxcol; ++$offset) { $cellID = "HR_" . $state->row . "_" . $offset; $HTML .= "//next Hours " . $offset . "...\n"; $HTML .= "cell = document.getElementById('" . $cellID . "');\n"; $HTML .= "cellValue = cell.innerHTML;\n"; if ($rates[$offset] == 0) { //no hourly rate so no input $HTML .= "fill = \"<div name='txtHours" . $offset . "' id='txtHours" . $offset . "_ID'>"; $HTML .= "Rate not available</div>\";\n"; } else { $HTML .= "fill = \"<input type='text' name='txtHours" . $offset . "' id='txtHours" . $offset . "_ID' size='3'"; $HTML .= " maxlength='6' class='number' onblur='audit_hours(this)' value='\"+cellValue+\"'>\";\n"; if ($state->extension != "") { $HTML .= "if (cellValue != 0) {\n"; $HTML .= " fill += \"<br><img src='" . $_SESSION["BUTLER"] . "?IAm=IG&file=extension.png&ver=" . $_VERSION . "'"; $conf = parse_ini_file($_SESSION["_SITE_CONF"]["_EXTENSIONS"] . $state->extension . "_conf.php"); $HTML .= " title='click for " . $conf["title"] . "'"; $HTML .= " onclick = 'return extension(\\\"" . $_SESSION["BUTLER"] . "?IAm=EN\\\",get_cell_recid(\\\"" . $cellID . "\\\")," . $conf["width"] . "," . $conf["height"] . ")'>\";\n"; $HTML .= "}\n"; } } $HTML .= "if (cell.getAttribute('data-recid') >= 0) {\n"; $HTML .= " cell.innerHTML = fill;\n"; $HTML .= "}\n"; } }
break 2; case SELECT_SPECS: //set the from and to dates require_once "calendar.php"; //catches $_GET refresh require_once "date_select.php"; $dates = unserialize($_STATE->date_select); if (!$dates->POST()) { $calendar = unserialize($_STATE->calendar); $_STATE->msgGreet = $_STATE->project_name . "<br>Select the list style and date range"; break 2; } set_state($dates); $_STATE->inactive_date = clone $_STATE->to_date; $_STATE->inactive_date->add(new DateInterval('P1D')); active_rates(); $_STATE->status = SELECTED_SPECS; //for possible goback $_STATE->replace(); // break 1; //re_switch // break 1; //re_switch case SELECTED_SPECS: log_list($_STATE); $_STATE->msgGreet = "Log entry for " . $_STATE->person_name . "<br>To add or change hours: click on the lefthand column"; $_STATE->extension = ""; set_closedCols(); $_STATE->scion_start("SHEET"); //create the child state stack $_STATE->status = SHEET_DISP; break 2; case SHEET_DISP:
function amount_send(&$state, &$HTML) { if ($state->mode == "l") { //list style ; only one amount field $offset = 0; $maxcol = 1; } else { //tabular style $offset = $state->columns[COL_OPEN]; $maxcol = $state->columns[COL_INACTIVE]; if ($state->row == 0) { //0 is add row $state->extension = ""; } else { log_list($state, $state->row); //find row specific stuff $record = reset($state->records); } } $rates = active_rates($state->project_id); for ($offset = $offset; $offset < $maxcol; ++$offset) { $cellID = "AM_" . $state->row . "_" . $offset; $HTML .= "//next Amount " . $offset . "...\n"; $HTML .= "cell = document.getElementById('" . $cellID . "');\n"; $HTML .= "cellValue = cell.getAttribute('data-value');\n"; if ($rates[$offset] == 0) { //no hourly rate so no input $HTML .= "fill = \"<div name='txtAmount" . $offset . "' id='txtAmount" . $offset . "_ID'>"; $HTML .= "Rate not available</div>\";\n"; } else { $HTML .= "fill = \"<input type='text' name='txtAmount" . $offset . "' id='txtAmount" . $offset . "_ID' size='5'"; $HTML .= " maxlength='6' class='number' onblur='audit_amount(this,99)' value='\"+cellValue+\"'>\";\n"; } $HTML .= "if (cell.getAttribute('data-recid') >= 0) {\n"; $HTML .= " cell.innerHTML = fill;\n"; $HTML .= "}\n"; } }