function smarty_function_resizeImg($params, &$smarty) { $size = getimagesize($params["src"]); //------------------------------------------------- if ($size[0] / $params["parent_width"] > $size[1] / $params["parent_height"]) { $width = $params["parent_width"] - $params["pad"] * 2; $ratio = $width / $size[0]; $height = $size[1] * $ratio; } else { $height = $params["parent_height"] - $params["pad"] * 2; $ratio = $height / $size[1]; $width = $size[0] * $ratio; } //------------------------------------------------- $par_dim = array("width" => $params["parent_width"], "height" => $params["parent_height"]); $dim = array("width" => $width, "height" => $height); $css = align($par_dim, $dim, $params["align"]); //------------------------------------------------- return '<img style = "position:absolute; left:' . $css['left'] . 'px; top:' . $css['top'] . 'px;" src = ' . $params["src"] . ' width = ' . $width . ' height = ' . $height . '>'; }
function printit($payrollid = 0) { $this->load->model('payrollmd'); $tmpl = array('table_open' => '<table class="printing" border="0" cellpadding="4" cellspacing="1" width="100%" style="background:#333;font-size:12px;font-family:tahoma">', 'heading_cell_start' => '<th style="background:#CCC;color:#000">', 'heading_cell_end' => '</th style="background:#CCC;color:#000">', 'row_start' => '<tr style="background:#FFF">', 'row_alt_start' => '<tr style="background:#FFF">'); $this->table->set_template($tmpl); $sql = "SELECT * FROM settings"; $setting = array(); $settings = $this->db->query($sql); foreach ($settings->result() as $r) { $setting[$r->name] = $r->value; } $sql = "SELECT * FROM payroll WHERE payrollid={$payrollid};"; $payroll = $this->db->query($sql)->row(); $datefrom = explode("-", $payroll->payperiod_from); $dateto = explode("-", $payroll->payperiod_to); $tag['datefrom'] = date('M d, Y', mktime(0, 0, 0, $datefrom[1], $datefrom[2], $datefrom[0])); $tag['dateto'] = date('M d, Y', mktime(0, 0, 0, $dateto[1], $dateto[2], $dateto[0])); $tag['payrollid'] = $payrollid; $sql = "SELECT e.idnumber, pd.empid, e.firstname, e.lastname, e.middlename, e.taxcode,\n\t\t\t\t\tb.amount, b.allowance, b.maxhours, b.maxbreakhours, b.maxworkdays, b.nightdiffin, b.nightdiffout, b.halfday,\n\t\t\t\t\tb.sss, b.pagibig, b.philhealth\n\t\t\t\t\tFROM payroll_detail pd \n\t\t\t\t\tINNER JOIN employee e ON e.empid=pd.empid\n\t\t\t\t\tINNER JOIN basic b ON b.empid=pd.empid\n\t\t\t\t\tINNER JOIN schedule s ON s.empid=pd.empid \n\t\t\t\t\tWHERE payrollid={$payrollid} \n\t\t\t\t\tGROUP BY pd.empid;"; $currentemp = $this->db->query($sql); $this->table->clear(); $this->table->set_heading('ID', 'Name', 'Rate', 'Rate/Hour', 'Reg Hr', '# Late', 'Nigth Diff Hrs', 'OT Hours', 'Holiday Hrs OT', 'Hrs UT', 'Basic Pay', 'Reg OT Pay', 'Holiday OT Pay', 'Night Diff Pay', 'Other Income', 'Undertime', 'Absences', 'Late Amount', 'Other Deductions', 'Gross Pay', 'WTax', 'SSS', 'Philhealth', 'Pagibig', 'Loan', 'Allowances', 'Net Pay'); $net_total = 0; foreach ($currentemp->result() as $row) { $tpay = $this->compute($payrollid, $row->empid); $this->table->add_row(align($tpay['idnumber'], 'c'), $tpay['name'], align(number_format($tpay['rate_per_day'], 2), 'r'), align(number_format($tpay['rate_per_hour'], 2), 'r'), align($tpay['reghours'], 'c'), align($tpay['late_hour'], 'c'), align(number_format($tpay['nitediff_hours'], 2), 'c'), align(number_format($tpay['ot_hours'], 2), 'r'), align(number_format($tpay['ot_hours_holiday'], 2), 'c'), align(number_format($tpay['undertime'], 2), 'c'), align(number_format($tpay['basic'], 2), 'r'), align(number_format($tpay['reg_ot_pay'], 2), 'r'), align(number_format($tpay['holiday_ot_pay'], 2), 'r'), align(number_format($tpay['nitediff_pay'], 2), 'r'), align(number_format($tpay['other_income'], 2), 'r'), align(number_format($tpay['undertime_amount'], 2), 'r'), align(number_format($tpay['absent'], 2), 'r'), align(number_format($tpay['late'], 2), 'r'), align(number_format($tpay['other_deduction'], 2), 'r'), align(number_format($tpay['gross_pay'], 2), 'r'), align(number_format($tpay['withholding'], 2), 'r'), align(number_format($tpay['sss'], 2), 'r'), align(number_format($tpay['philhealth'], 2), 'r'), align(number_format($tpay['pagibig'], 2), 'r'), align(number_format($tpay['loans'], 2), 'r'), align(number_format($tpay['allowance'], 2), 'r'), align(number_format($tpay['netpay'], 2), 'r')); //netpay $net_total += $tpay['netpay']; } $this->table->add_row(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '<strong>Total</strong>', align(number_format($net_total, 2), 'r')); //$tag['payroll_calculator'] = '<div style="width:745px;overflow:auto">'.$this->table->generate().'</div>'; $tag['content'] = '<div>Payroll Period: <span style="text-decoration:underline">' . $tag['datefrom'] . ' - ' . $tag['dateto'] . '</span></div>'; $tag['content'] .= '<div style="padding-bottom:50px">' . $this->table->generate() . '</div>'; $tag['content'] .= '<table cellpadding="2" cellspacing="0" width="100%" border="0" style="font-size:12px"> <tr> <td width="35%" align="center"><span style="font-weight:bold">Sarah S. Enopia</span><br/>Prepared by</td> <td align="center"><span style="font-weight:bold">Arlyn Siarot</span><br/>Checked by</td> <td width="35%" align="center"><span style="font-weight:bold">Deo Dumaraos</span><br/>Approved by</td> </tr> </table>'; echo $tag['content']; echo "<script>window.print();</script>"; }
private function buildHTMLForSubform($CRLF, $TAB, $fieldName, $fieldTitle, $blankRows, $objectID) { if (!$this->displayThisObject) { return ''; } else { $this->parentForm->subformNames[] = $this->objectProperty['sob_all_name']; $this->parentForm->subformTabs[] = $this->parentForm->formTabNames[$this->objectProperty['sob_all_tab_title']]; } $format = textFormatsArray(); if ($this->objectProperty['sob_all_on_change'] != '') { $OnChange = 'onchange="' . $this->objectProperty["sob_all_on_change"] . '" '; } $this->CRLF = $CRLF; $this->TAB = $TAB; $hGap = 3; //gap between fields $vHeight = 23; //row height $vTitleHeight = $this->objectProperty['sob_subform_title_height'] * 16; //row height $vTop = 10; //row height $sfDimensions = array(); $fldDimensions = array(); $t = nuRunQuery("SELECT * FROM zzsys_object WHERE sob_zzsys_form_id = '" . $this->objectProperty['zzsys_object_id'] . "' ORDER BY sob_all_column_number, sob_all_order_number"); while ($r = db_fetch_array($t)) { $objectLength = $r['sob_' . $r['sob_all_type'] . '_length']; // eg. text objects are 'sob_text_length' if ($r['sob_all_type'] == 'lookup') { $objectLength = $r['sob_lookup_code_length']; // code length if ($r['sob_lookup_no_description'] != '1') { $objectLength = $objectLength + 0.5 + $r['sob_lookup_description_length']; // description length } } if ($r['sob_all_type'] == 'text') { if ($format[$r['sob_text_format']]->type == 'date') { $objectLength = $objectLength + 1.5; // date button length } } $fldDimensions[$r['sob_all_name']]->type = $r['sob_all_type']; $fldDimensions[$r['sob_all_name']]->columnAlign = 'left'; if ($r['sob_all_type'] == 'text') { $fldDimensions[$r['sob_all_name']]->columnAlign = $r['sob_text_align']; } if ($r['sob_all_type'] == 'display') { $fldDimensions[$r['sob_all_name']]->columnAlign = $r['sob_display_align']; } $fldDimensions[$r['sob_all_name']]->columnTitle = $r['sob_all_title']; $fldDimensions[$r['sob_all_name']]->column = $r['sob_all_column_number']; $fldDimensions[$r['sob_all_name']]->leftCoordinate = round($sfDimensions[$r['sob_all_column_number']]->columnWidth); $fldDimensions[$r['sob_all_name']]->columnWidth = $objectLength * 16 + $hGap; $sfDimensions[$r['sob_all_column_number']]->columnWidth = round($sfDimensions[$r['sob_all_column_number']]->columnWidth) + $fldDimensions[$r['sob_all_name']]->columnWidth; $colHeight = round($sfDimensions[$r['sob_all_column_number']]->columnHeight); if ($colHeight == 0) { $sfDimensions[$r['sob_all_column_number']]->columnHeight = $vHeight; $colHeight = $sfDimensions[$r['sob_all_column_number']]->columnHeight; } if ($r['sob_all_type'] == 'textarea' and $colHeight < $r['sob_textarea_height'] * 16) { $sfDimensions[$r['sob_all_column_number']]->columnHeight = $r['sob_textarea_height'] * 16; } } $longest = ''; foreach ($sfDimensions as $key => $value) { // get longest row if ($value->columnWidth > $longest) { $longest = $value->columnWidth; } $rowHeight = $rowHeight + $value->columnHeight; } $prntCheckBox = $this->objectProperty['sob_subform_delete_box'] == '1' and $this->objectProperty['sob_subform_read_only'] != '1'; if ($prntCheckBox) { //add room for the delete tick box $longest = $longest + $vHeight; } else { $longest = $longest + 20; } //add scroll bar $sfWidth = $longest + 20; $sfLeft = $this->objectProperty['sob_subform_left']; //add height of subform title + column title(s) to overall height $sfHeight = $this->objectProperty['sob_subform_height'] * 16 - $this->objectProperty['sob_subform_title_height'] * 16 - 100; $sfTop = $this->objectProperty['sob_subform_top']; if ($this->objectProperty['sob_subform_width'] == 0) { $scsfWidth = $sfWidth + 10; } else { $scsfWidth = $this->objectProperty['sob_subform_width']; } $scsfHeight = $sfHeight - 20; $scsfHeight = $sfHeight - 16; //changed from -10 to -16 $s = "<div name='sf_title{$fieldName}' id='sf_title{$fieldName}' class='selected' style='text-align:left;position:absolute;height:20;top:{$sfTop};left:{$sfLeft};width:{$sfWidth};'>{$fieldTitle}</div>{$CRLF}"; $sfTop = $sfTop + 20; $s = $s . "{$TAB}<div name='{$fieldName}' id='{$fieldName}' class='selected' style='position:absolute;overflow:auto;width:{$scsfWidth};height:{$scsfHeight};top:{$sfTop};left:{$sfLeft};'>{$CRLF}"; $s = $s . "{$TAB} <div name='title{$fieldName}' id='title{$fieldName}' style='position:absolute;top:0;left:0;background:#6D7B8D'>{$CRLF}"; // build subform column titles $columnTop = 0; $columnNumber = ''; foreach ($fldDimensions as $key => $value) { if ($columnNumber != $value->column) { if ($columnNumber == '') { $columnNumber = $value->column; } } if ($columnTop == 0) { // only print headings for the first row (sob_subform_column_order) if ($columnNumber == $value->column) { $width = $value->columnWidth; $dbc = ''; if ($this->parentForm->zzsys_user_id == 'globeadmin' and $this->form->sys_setup != '1') { $dbc = " ondblclick=\"openBrowse('object', '{$objectID}', '', '" . $this->parentForm->session . "', '')\""; } $s = $s . "{$TAB} <div {$dbc} class='unselected' style='vertical-align:top;font-size:x-small;font-family:tahoma;font-weight:bold;top:0;left:{$value->leftCoordinate};width:{$width};height:{$vTitleHeight};overflow:hidden;position:absolute;text-align:" . align($value->columnAlign) . ";'>{$CRLF}"; $s = $s . "{$TAB} {$value->columnTitle}{$CRLF}"; $s = $s . "{$TAB} </div>{$CRLF}"; $nextLeft = $value->leftCoordinate + $value->columnWidth; } } } $sfHeight = $sfHeight - $columnTop - $vHeight; // adjusting for scrollng div $this->objectName = $this->objectProperty['sob_all_name']; // set subform name //add room for the delete tick box if ($this->objectProperty['sob_subform_read_only'] != '1') { $s = $s . "{$TAB} <div class='unselected' style='top:0;left:{$nextLeft};width:50;height:{$vTitleHeight};overflow:hidden;position:absolute;align:left;'>{$CRLF}"; //align:left removed if ($prntCheckBox) { $s = $s . "{$TAB} <font style='vertical-align:top;font-size:xx-small;font-family:tahoma;font-weight:bold;'> Delete </font>{$CRLF}"; } $s = $s . "{$TAB} </div>{$CRLF}"; } //end of subform column titles //start scrolling div $sfHeight = $sfHeight - $vTitleHeight; // adjust a bit to see all of scroll bar $columnTop = $columnTop + $vTitleHeight; //added by nick 10-06-09 $grey needs to be defined before it can be used //vvvvv $grey = iif($grey == $this->objectProperty['sob_subform_odd_background_color'], $this->objectProperty['sob_subform_even_background_color'], $this->objectProperty['sob_subform_odd_background_color']); //^^^^^ $subformClass = str_replace('.', '', $this->objectProperty['sob_all_class']); $s = $s . "{$TAB} <div name='scroller{$fieldName}' class='{$subformClass}' id='scroller{$fieldName}' style='border-style:solid;border-width:2;border-color:white;position:absolute;overflow:scroll;width:{$sfWidth};height:{$sfHeight};top:{$columnTop};left:0;background:{$grey};'>{$CRLF}"; //put subform objects in an array $subformObjects = array(); $t = nuRunQuery("SELECT * FROM zzsys_object WHERE sob_zzsys_form_id = '" . $this->objectProperty['zzsys_object_id'] . "' ORDER BY sob_all_column_number, sob_all_order_number"); while ($r = db_fetch_object($t)) { $subformObjects[] = $r; } //get SQL for subform // $subformSQL = replaceVariablesInString($this->TT,$this->objectProperty['sob_subform_sql'], $this->recordID); //get SQL for subform //-- added by sc 4-feb-2009 if (is_array($this->parentForm->recordValues)) { $hVariables = arrayToHashArray($this->parentForm->recordValues); //--session values (access level and user etc. ) } $subformSQL = replaceVariablesInString($this->TT, $this->objectProperty['sob_subform_sql'], $this->recordID); if (is_array($this->parentForm->recordValues)) { $subformSQL = replaceHashVariablesWithValues($hVariables, $subformSQL); } //--------- $subformTable = nuRunQuery($subformSQL); $columnTop = $vHeight * -1 + 5; $nextTop = 0; $columnNumber = ''; //loop through subform records if ($this->parentForm->cloning == '1') { $primaryKey = ''; } else { $primaryKey = $this->objectProperty['sob_subform_primary_key']; } while ($subformRecord = mysql_fetch_array($subformTable)) { $this->recordID = $subformRecord[$this->objectProperty['sob_subform_primary_key']]; $this->nextRowNumber(); //loop through each object for this subform record $newRow = true; $grey = iif($grey == $this->objectProperty['sob_subform_odd_background_color'], $this->objectProperty['sob_subform_even_background_color'], $this->objectProperty['sob_subform_odd_background_color']); $dq = '"'; $s = $s . "{$TAB} <div id='rowdiv_{$this->subformPrefix}' onfocus='SFrowColor(this, {$dq}{$fieldName}{$dq})' style='background:{$grey};height:{$rowHeight}'>{$CRLF}"; $checkBoxDone = false; for ($i = 0; $i < count($subformObjects); $i++) { $subformFieldDiv = $fldDimensions[$subformObjects[$i]->sob_all_name]; if ($columnNumber != $subformFieldDiv->column or $i == 0) { $columnNumber = $subformFieldDiv->column; $columnTop = $nextTop; $nextTop = $columnTop + $sfDimensions[$columnNumber]->columnHeight; } //add room for the delete tick box if ($prntCheckBox and !$checkBoxDone) { $checkBoxDone = true; $s = $s . "{$TAB} <div style='position:absolute;top:{$columnTop};left:{$nextLeft}'>{$CRLF}"; $s = $s . "{$TAB} <input name='row{$this->subformPrefix}' id='row{$this->subformPrefix}' type='checkbox' {$OnChange} tabindex='-1'/>{$CRLF}"; $s = $s . "{$TAB} </div>{$CRLF}"; } $s = $s . "{$TAB} <div name='row{$this->subformPrefix}' id='row{$this->subformPrefix}' style='background:lightgray;position:absolute;top:{$columnTop};left:{$subformFieldDiv->leftCoordinate}'>{$CRLF}"; $fieldWidth = $subformFieldDiv->columnWidth - $hGap; if ($newRow) { $s = $s . "{$TAB} <input name='{$this->subformPrefix}{$primaryKey}' id='{$this->subformPrefix}{$primaryKey}' value='{$this->recordID}' type='hidden'/>{$CRLF}"; $newRow = false; } $s = $s . "{$TAB} " . $this->buildObject($subformObjects[$i], $subformRecord) . "{$CRLF}"; $s = $s . "{$TAB} </div>{$CRLF}"; } $rowNumber = $rowNumber + 1; $newRow = true; $s = $s . "{$TAB} </div>{$CRLF}"; } $sfRowTotal = $rowNumber + $blankRows; $columnNumber = ''; //loop through blank subform records for ($blankRecord = 0; $blankRecord < $blankRows; $blankRecord++) { $this->recordID = '-1'; $this->nextRowNumber(); //loop through each object for this subform record $grey = iif($grey == $this->objectProperty['sob_subform_odd_background_color'], $this->objectProperty['sob_subform_even_background_color'], $this->objectProperty['sob_subform_odd_background_color']); // $grey = iif($grey=='#E0E0E0 ','#F0F0F0','#E0E0E0 '); $s = $s . "{$TAB} <div style='background:{$grey};height:{$rowHeight}'>{$CRLF}"; $checkBoxDone = false; for ($i = 0; $i < count($subformObjects); $i++) { $subformFieldDiv = $fldDimensions[$subformObjects[$i]->sob_all_name]; if ($columnNumber != $subformFieldDiv->column) { $columnNumber = $subformFieldDiv->column; $columnTop = $nextTop; $nextTop = $columnTop + $sfDimensions[$columnNumber]->columnHeight; } //add room for the delete tick box if ($prntCheckBox and !$checkBoxDone) { $checkBoxDone = true; $s = $s . "{$TAB} <div style='position:absolute;top:{$columnTop};left:{$nextLeft}'>{$CRLF}"; $s = $s . "{$TAB} <input name='row{$this->subformPrefix}' id='row{$this->subformPrefix}' type='checkbox' {$OnChange} tabindex='-1' checked='checked'/>{$CRLF}"; $s = $s . "{$TAB} </div>{$CRLF}"; } $s = $s . "{$TAB} <div name='{$this->subformPrefix}' id='{$this->subformPrefix}' style='position:absolute;top:{$columnTop};left:{$subformFieldDiv->leftCoordinate}'>{$CRLF}"; $fieldWidth = $subformFieldDiv->columnWidth - $hGap; $s = $s . "{$TAB} " . $this->buildObject($subformObjects[$i], $subformRecord) . "{$CRLF}"; $s = $s . "{$TAB} </div>{$CRLF}"; } $rowNumber = $rowNumber + 1; $columnNumber = ''; $s = $s . "{$TAB} </div>{$CRLF}"; } $s = $s . "{$TAB} </div>{$CRLF}"; $s = $s . "{$TAB} </div>{$CRLF}"; $s = $s . "{$TAB} </div>{$CRLF}"; $s = $s . "{$TAB} <div style='position:absolute;overflow:hidden;width:0;height:0;top:0;left:10;background:blue;'>{$CRLF}"; $sfColumns = count($fldDimensions); $s = $s . "{$TAB} <input name='subformid{$fieldName}' id='subformid{$fieldName}' value='" . $this->objectProperty['zzsys_object_id'] . "' type='hidden' />{$CRLF}"; $s = $s . "{$TAB} <input name='rows{$fieldName}' id='rows{$fieldName}' value='{$sfRowTotal}' type='hidden' />{$CRLF}"; $s = $s . "{$TAB} <input name='columns{$fieldName}' id='columns{$fieldName}' value='{$sfColumns}' type='hidden' />{$CRLF}"; $s = $s . "{$TAB} <input name='table{$fieldName}' id='table{$fieldName}' value='" . $this->objectProperty['sob_subform_table'] . "' type='hidden' />{$CRLF}"; $s = $s . "{$TAB} <input name='foreignkey{$fieldName}' id='foreignkey{$fieldName}' value='" . $this->objectProperty['sob_subform_foreign_key'] . "' type='hidden' />{$CRLF}"; $s = $s . "{$TAB} <input name='primarykey{$fieldName}' id='primarykey{$fieldName}' value='" . $this->objectProperty['sob_subform_primary_key'] . "' type='hidden' />{$CRLF}"; $s = $s . "{$TAB} <input name='readonly{$fieldName}' id='readonly{$fieldName}' value='" . $this->objectProperty['sob_subform_read_only'] . "' type='hidden' />{$CRLF}"; $s = $s . "{$TAB} <input name='deletebox{$fieldName}' id='deletebox{$fieldName}' value='" . $this->objectProperty['sob_subform_delete_box'] . "' type='hidden' />{$CRLF}"; $s = $s . "{$TAB} <input name='rowColor_{$fieldName}' id='rowColor_{$fieldName}' value='" . $this->objectProperty['sob_subform_selected_row_color'] . "' type='hidden' />{$CRLF}"; $s = $s . "{$TAB} <input name='lastRow_{$fieldName}' id='lastRow_{$fieldName}' value='' type='hidden' />{$CRLF}"; $s = $s . "{$TAB} <input name='lastColor_{$fieldName}' id='lastColor_{$fieldName}' value='' type='hidden' />{$CRLF}"; $cNo = 0; foreach ($fldDimensions as $key => $value) { $s = $s . "{$TAB} <input name='{$fieldName}{$cNo}' id='{$fieldName}{$cNo}' value='{$key}' type='hidden' />{$CRLF}"; $cNo = $cNo + 1; } $s = $s . "{$TAB}</div>{$CRLF}"; return $s; }
private function buildHTMLForDisplay($CRLF, $TAB, $fieldName, $fieldTitle, $fieldValue) { if ($this->displayThisObject) { $inputType = 'text'; } else { $inputType = 'hidden'; $fieldTitle = ''; } if ($this->parentType == 'form') { //--not a subform $titleTableDetail = "{$TAB} <td class='selected' bgcolor='{$this->bgcolor}' style='text-align:right'>{$fieldTitle}</td>{$CRLF}"; $tr1 = "{$TAB}<tr class='selected'>{$CRLF}"; $tr2 = "{$TAB}</tr>{$CRLF}"; $td1 = "{$TAB} <td class='selected' style='text-align:left'>{$CRLF}{$TAB} "; $td2 = "{$TAB} </td>{$CRLF}"; } $style = $this->addStyle('width', $this->objectProperty['sob_display_length'] * 16); $style = $style . $this->addStyle('text-align', align($this->objectProperty['sob_display_align'])); $s = $titleTableDetail . $td1; $s = $s . "<input "; $s = $s . $this->addProperty('type', $inputType); $s = $s . $this->addProperty('name', $fieldName); $s = $s . $this->addProperty('id', $fieldName); $s = $s . $this->addProperty('value', $fieldValue); $s = $s . $this->addProperty('accesskey', $this->objectProperty['sob_all_access_key']); if ($inputType == 'text') { if ($this->objectProperty['sob_all_class'] == '') { $s = $s . $this->addProperty('class', 'objects'); } else { $s = $s . $this->addProperty('class', $this->objectProperty['sob_all_class']); } $s = $s . $this->addProperty('style', $style); } $s = $s . " readonly='readonly' tabindex='-1'/>{$CRLF}"; $s = $s . $td2; return $tr1 . $s . $tr2; }
public function buildBody() { $percentAmount = 1; $select = ''; $dq = '"'; $this->SQL->removeAllFields(); $s = "<table >{$this->CRLF}"; $s = $s . "<tr >{$this->CRLF}"; for ($i = 0; $i < count($this->Column); $i++) { $this->SQL->addField($this->Column[$i]->sbr_display); $a = align($this->Column[$i]->sbr_align); $s = $s . "{$this->TAB}<th align='{$a}' bgcolor='lightgrey'>{$this->CRLF}"; $desc = iif($i == $this->orderBy and $this->isDescending == '', '1', ''); $s = $s . "{$this->TAB}{$this->TAB}<a href='#' onclick='newOrder({$dq}{$i}{$dq}, {$dq}{$desc}{$dq})'>" . $this->Column[$i]->sbr_title . "</a>{$this->CRLF}"; $s = $s . "{$this->TAB}</th>{$this->CRLF}"; } $s = $s . "</tr>{$this->CRLF}"; $page = ($this->PageNo - 1) * $this->pageLength; tofile("{$page} = ({$this->PageNo} -1) * {$this->pageLength}"); $this->SQL->addField($this->callingForm->sfo_primary_key); $primaryKeyNumber = count($this->SQL->fields) - 1; $t = nuRunQuery($this->SQL->SQL . " LIMIT {$page}, 9"); $top = -15; $row = 0; while ($r = db_fetch_row($t)) { $theID = $r[$primaryKeyNumber]; $rowname = 'rw' . substr('0' . $row, -2); $param = '"' . $rowname . '"'; $left = 0; $top = $top + $this->rowHeight; $s = $s . "<tr id='browse'>{$this->CRLF}"; $color = iif($color == 'Gainsboro', 'white', 'Gainsboro'); for ($i = 0; $i < count($this->Column); $i++) { $w = $this->Column[$i]->sbr_width * $percentAmount; $a = align($this->Column[$i]->sbr_align); $s = $s . "{$this->TAB}<td bgcolor='{$color}' align='{$a}'>{$this->CRLF}"; if ($i == 0) { if ($this->isLookup) { $theObject = $this->objectID; $s = $s . "{$this->TAB}{$this->TAB} <a href='formlookupsmall.php?x=1&f={$this->theFormID}&ob={$theObject}&r={$theID}&fr=" . $_GET['fr'] . "&dir=" . $_GET['dir'] . "&ses=" . $_GET['ses'] . "'>" . formatTextValue($r[$i], $this->Column[$i]->sbr_format) . "</a> {$this->CRLF}"; } else { $s = $s . "{$this->TAB}{$this->TAB} <a href='formsmall.php?x=1&f={$this->theFormID}&fr={$theID}&dir=" . $_GET['dir'] . "&ses=" . $_GET['ses'] . "'>" . formatTextValue($r[$i], $this->Column[$i]->sbr_format) . "</a> {$this->CRLF}"; } } else { $s = $s . "{$this->TAB}{$this->TAB} " . formatTextValue($r[$i], $this->Column[$i]->sbr_format) . " {$this->CRLF}"; } $s = $s . "{$this->TAB}</td>{$this->CRLF}"; } $s = $s . "{$this->TAB}</tr>{$this->CRLF}"; $row = $row + 1; } $s = $s . '</table>'; return $s; }
public function buildBody() { $left = 0; $pageWidth = 968; $percentAmount = 1; $select = ''; $this->SQL->removeAllFields(); $s = "<div id='BorderDiv' class='nuborder' class='unselected' style='overflow:hidden;position:absolute;top:80; left:10; width:972; height:600' ></div>{$CRLF}"; $s = $s . "<div id='browse' class='unselected' style='vertical-align:text-bottom;visibility:visible;overflow:hidden;position:absolute;top:85; left:12; width:{$pageWidth}; height:30' >{$this->CRLF}"; for ($i = 0; $i < count($this->Column); $i++) { $this->SQL->addField($this->Column[$i]->sbr_display); $w = $this->Column[$i]->sbr_width * $percentAmount; $a = align($this->Column[$i]->sbr_align); $s = $s . "{$this->TAB}<div class='unselected' style='overflow:hidden;position:absolute;text-align:{$a};top:0;left:{$left};width:{$w};height:20'>{$this->CRLF}"; $desc = iif($i == $this->orderBy and $this->isDescending == '', '1', ''); $s = $s . "{$this->TAB}{$this->TAB}<span style='cursor:hand;font-size:x-small;font-family:tahoma;font-weight:bold;height:50' id='title{$i}' onmouseout='TOUT(this)' onmouseover='TIN(this)' onclick='runOrder({$i}, \"{$desc}\")'> " . $this->Column[$i]->sbr_title . " </span>{$this->CRLF}"; $s = $s . "{$this->TAB}</div>{$this->CRLF}"; $left = $left + $w; } $s = $s . "</div>{$this->CRLF}"; $s = $s . "<div id='browse' class='browse' style='visibility:visible;overflow:hidden;position:absolute;top:105; left:12; width:{$pageWidth}; height:556' >{$this->CRLF}"; $page = ($this->PageNo - 1) * $this->pageLength; $this->SQL->addField($this->form->sfo_primary_key); $primaryKeyNumber = count($this->SQL->fields) - 1; //tofile('browse sql:'.$this->SQL->SQL); $t = nuRunQuery($this->SQL->SQL . " LIMIT {$page}, 27"); $top = -10; $row = 0; while ($r = db_fetch_row($t)) { $theID = '"' . $r[$primaryKeyNumber] . '"'; $rowname = 'rw' . substr('0' . $row, -2); $param = '"' . $rowname . '"'; $left = 0; $top = $top + $this->rowHeight; for ($i = 0; $i < count($this->Column); $i++) { $w = $this->Column[$i]->sbr_width * $percentAmount; $a = align($this->Column[$i]->sbr_align); $s = $s . "{$this->TAB}<div onmouseover='MIN({$param})' onmouseout='MOUT({$param})' onclick='doIt({$theID})' class='browse' id='{$rowname}{$i}' style='cursor:hand;text-align:{$a};top:{$top};left:{$left};width:{$w};height:{$this->rowHeight}'>{$this->CRLF}"; $s = $s . "{$this->TAB}{$this->TAB} " . formatTextValue($r[$i], $this->Column[$i]->sbr_format) . " {$this->CRLF}"; $s = $s . "{$this->TAB}</div>{$this->CRLF}"; $left = $left + $w; } $w = iif($left < $pageWidth, $pageWidth - $left, 0); $s = $s . "{$this->TAB}<div onmouseover='MIN({$param})' onmouseout='MOUT({$param})' onclick='doIt({$theID})' class='browse' id='{$rowname}{$i}' style='cursor:hand;top:{$top};left:{$left};width:{$w};height:{$this->rowHeight}'>{$this->CRLF}"; $s = $s . "{$this->TAB}</div>{$this->CRLF}"; // allow keyboad movement $s = $s . "{$this->TAB}<div onmouseover='MIN({$param})' onmouseout='MOUT({$param})' class='browse' id='hidden{$rowname}{$i}' style='top:{$top};left:{$left};width:0;height:{$this->rowHeight}'>{$this->CRLF}"; $s = $s . "{$this->TAB}<input onfocus='MIN({$param})' onblur='MOUT({$param})' >{$this->CRLF}"; $s = $s . "{$this->TAB}</div>{$this->CRLF}"; $row = $row + 1; } $s = $s . '</div>'; //------print login name $slogin = "******"; $t = nuRunQuery("SELECT * FROM zzsys_user WHERE zzsys_user_id = '{$this->zzsys_user_id}'"); $r = db_fetch_object($t); if ($this->form->sfo_help != '') { $help = "title='help' onclick='openHelp(" . '"' . $this->form->zzsys_form_id . '")' . "'"; } else { $help = ""; } if ($r->sus_login_name == '') { $r->sus_login_name = 'globeadmin'; } $slogin = $slogin . "<span id='nuuser' class='unselected' style='font-size:10;font-weight:normal' {$help} >{$r->sus_login_name} </span></div>{$CRLF}"; $slogin = $slogin . "<div id='BorderDiv3' class='nuborder' style='overflow:hidden;position:absolute;top:664;left:12;width:200;height:15;text-align:left' >{$CRLF}"; $slogin = $slogin . "<span id='powered' class='unselected' style='font-size:10;font-weight:normal'>Powered by nuBuilder</span></div>{$CRLF}"; return $s . $slogin; }
$alpha7 = (~(int) $_bg_color_val[3] & 0xff) >> 1; $_bg_color = imagecolorallocatealpha($image, $_bg_color_val[2], $_bg_color_val[1], $_bg_color_val[0], $alpha7); } } if ($_GET["bg_color"] == "transparent") { $_bg_color = imagecolorallocatealpha($image, 255, 255, 255, 127); } } //Make the background black ImageFill($image, 0, 0, $_bg_color); $loop_count = $_str_has_auth == true ? count($exploded_string) - 1 : count($exploded_string); for ($i = 0; $i < $loop_count; $i++) { ImageString($image, $_font, align($exploded_string[$i], $_align), $i * imagefontheight($_font), $exploded_string[$i], $_color); } if ($_str_has_auth) { ImageString($image, $_font, align("-- " . $exploded_string[$loop_count], opp_align($_align)), $loop_count * imagefontheight($_font), "-- " . $exploded_string[$loop_count], $_color); } //Tell the browser what kind of file is come in header("Content-Type: image/" . $_type); //$_type_s = array("jpeg", "gif", "png", "webp"); switch ($_type) { case "gif": imagegif($image); break; case "png": imagepng($image); break; case "webp": $img_create_ret = imagewebp($image); if ($img_create_ret == false) { //fallback?