/** * * Create the HTML output for the list on the right * hand side of the showfaces.php page * @param int $cid course id * */ function build_menu($cid) { global $DB, $CFG, $rendertype; $orderby = ''; $orderby = optional_param('orderby', 'firstname', PARAM_TEXT); $outputhtml = '<div style="float:right"><form action="' . $CFG->wwwroot . '/blocks/faces/showfaces/show.php?cid=' . $cid . '" method="post"> ' . get_string('orderby', 'block_faces') . ': <select name="orderby" id="orderby"> <option value="firstname">' . get_string('firstname', 'block_faces') . '</option> <option value="lastname">' . get_string('lastname', 'block_faces') . '</option> </select> ' . get_string('filter', 'block_faces') . ': <select id="selectgroupsec" name="selectgroupsec"> <option value="all">' . get_string('showallfaces', 'block_faces') . '</option> ' . build_groups($cid) . ' </select> <input type="submit" value="' . get_string('update', 'block_faces') . '"></input> </form> <script>document.getElementById(\'orderby\').value="' . $orderby . '";</script> <span style="float:right"> <form target="_blank" action="../print/page.php"> <input type="hidden" name="cid" value="' . $cid . '"> <input type="hidden" name="rendertype" value="' . $rendertype . '"> '; // If a group was selected $selectgroupsec = optional_param('selectgroupsec', 'all', PARAM_TEXT); if (isset($selectgroupsec)) { $outputhtml .= '<input type="hidden" name="selectgroupsec" value="' . $selectgroupsec . '">'; } $outputhtml .= ' <script>document.getElementById(\'selectgroupsec\').value="' . $selectgroupsec . '";</script> '; $outputhtml .= ' <input type="hidden" name="orderby" value="' . $orderby . '"> <input type="submit" value="' . get_string('print', 'block_faces') . '"> </span> </form> </div> </div> '; return $outputhtml; }
$kFonts = gen_build_pull_down($Fonts); $kFontSizes = gen_build_pull_down($FontSizes); $kLineSizes = gen_build_pull_down($LineSizes); $kFontColors = gen_build_pull_down($FontColors); $kFontAlign = gen_build_pull_down($FontAlign); $cFields = CreateCompanyArray(); $fFields = crit_build_pull_down($CritChoices); $kFields = CreateSpecialDropDown($report); $kTblFields = CreateFieldTblDropDown($report); $kTables = CreateTableList($report); $nyChoice = gen_build_pull_down($NoYesChoice); $pFields = gen_build_pull_down($FormProcessing); $tProcessing = gen_build_pull_down($TextProcessing); $joinOptions = gen_build_pull_down($joinSyntax); // build the groups list $report_groups = build_groups($report_groups); $rFields = '<select name="groupname" id="groupname">' . chr(10); switch ($report->reporttype) { case 'rpt': $rFields .= '<optgroup label="' . TEXT_REPORTS . '">' . chr(10); foreach ($report_groups['reports'] as $key => $value) { $selected = $report->groupname == $key ? ' selected="selected"' : ''; $rFields .= '<option value="' . $key . '"' . $selected . '>' . htmlspecialchars($value) . '</option>' . chr(10); } $rFields .= '</optgroup>' . chr(10); break; case 'frm': $rFields .= '<optgroup label="' . TEXT_FORMS . '">' . chr(10); foreach ($report_groups['forms'] as $key => $value) { $selected = $report->groupname == $key ? ' selected="selected"' : ''; $rFields .= '<option value="' . $key . '"' . $selected . '>' . htmlspecialchars($value) . '</option>' . chr(10);
function s_print_3($show_groups = false) { global $user, $db, $config; if ($show_groups) { global $groups, $groups_legend; } ?> <tr> <td>Fecha Inicio</td> <td><?php print_date_select(1, true); ?> </td> </tr> <tr> <td>Fecha Final</td> <td><?php print_date_select(2, true); ?> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td>Fecha del reporte</td> <td><?php print_date_select(3); ?> </td> </tr> <?php if ($show_groups) { ?> <tr> <td>Grupo</td> <td><?php build_groups($groups, $groups_legend); ?> </td> </tr> <?php } }
// +-----------------------------------------------------------------+ // Path: /modules/phreeform/pages/main/pre_process.php // $security_level = validate_user(SECURITY_ID_PHREEFORM); /************** include page specific files *********************/ require DIR_FS_WORKING . 'defaults.php'; require DIR_FS_WORKING . 'functions/phreeform.php'; /************** page specific initialization *************************/ $error = false; $processed = false; history_filter(); $group = isset($_GET['group']) ? $_GET['group'] : false; $rID = isset($_POST['rowSeq']) ? db_prepare_input($_POST['rowSeq']) : db_prepare_input($_GET['docID']); $list = isset($_REQUEST['list']) ? $_REQUEST['list'] : $_POST['list']; $tab = $_GET['tab']; $groups = build_groups(); /*************** Act on the action request *************************/ switch ($_REQUEST['action']) { case 'copy': case 'rename': $doc_title = db_prepare_input($_POST['newName']); $report = get_report_details($rID); $report->title = $doc_title; if ($_REQUEST['action'] == 'rename') { $sql_array = array('doc_title' => $doc_title, 'last_update' => date('Y-m-d')); db_perform(TABLE_PHREEFORM, $sql_array, 'update', 'id = ' . $rID); $message = PHREEFORM_RENAME_SUCCESS; } else { $result = $db->Execute("select * from " . TABLE_PHREEFORM . " where id = '" . $rID . "'"); $sql_array = array('parent_id' => $result->fields['parent_id'], 'doc_title' => $doc_title, 'doc_group' => $report->groupname, 'doc_ext' => $report->reporttype, 'security' => $report->security, 'create_date' => date('Y-m-d')); db_perform(TABLE_PHREEFORM, $sql_array, 'insert');
function ReadDefReports($name, $path) { if (!($dh = @opendir(DIR_FS_ADMIN . $path))) { return TEXT_NO_DOCUMENTS; } $i = 0; while ($DefRpt = readdir($dh)) { $pinfo = pathinfo(DIR_FS_ADMIN . $path . '/' . $DefRpt); switch ($pinfo['extension']) { case 'txt': $FileLines = file(DIR_FS_ADMIN . $path . '/' . $DefRpt); foreach ($FileLines as $OneLine) { // find the main reports sql statement, language and execute it if (strpos($OneLine, 'ReportNarr:') === 0) { $ReportNarr = substr(trim($OneLine), 12, -1); } if (strpos($OneLine, 'ReportData:') === 0) { // then it's the line we're after with description and groupname $GrpPos = strpos($OneLine, "groupname='") + 11; $GrpName = substr($OneLine, $GrpPos, strpos($OneLine, "',", $GrpPos) - $GrpPos); $RptPos = strpos($OneLine, "description='") + 13; $RptName = substr($OneLine, $RptPos, strpos($OneLine, "',", $RptPos) - $RptPos); $ReportList[$GrpName][$i]['RptName'] = $RptName; $ReportList[$GrpName][$i]['RptNarr'] = $ReportNarr; $ReportList[$GrpName][$i]['FileName'] = $pinfo[basename]; $i++; } } break; case 'xml': $data = file_get_contents(DIR_FS_ADMIN . $path . '/' . $DefRpt); $report = xml_to_object($data); if (is_object($report->PhreeformReport)) { $report = $report->PhreeformReport; } // remove container tag $ReportList[$report->groupname][$i]['RptName'] = $report->title; $ReportList[$report->groupname][$i]['RptNarr'] = $report->description; $ReportList[$report->groupname][$i]['FileName'] = $pinfo[basename]; $i++; break; default: continue; // not a report } } closedir($dh); $OptionList = '<select name="' . $name . '" size="15">'; $LstGroup = ''; $CloseOptGrp = false; $i = 0; if (is_array($ReportList)) { $groups = build_groups(); ksort($ReportList); foreach ($ReportList as $GrpName => $members) { $group_split = explode(':', $GrpName); // if it's a form then remove the report from category id $GrpMember = $groups['reports'][$group_split[0]]; if (!$GrpMember) { $GrpMember = TEXT_MISC; } if (isset($group_split[1])) { $form_group = $groups['forms'][$GrpName]; if (!$form_group) { $form_group = TEXT_UNCAT_FORM; } $label = $GrpMember . ' - ' . TEXT_FORMS . ' - ' . $form_group; } else { $label = $GrpMember . ' - ' . TEXT_REPORTS; } $OptionList .= '<optgroup label="' . $label . '" title="' . $GrpName . '">'; foreach ($members as $Temp) { $OptionList .= '<option value="' . $Temp['FileName'] . '">' . htmlspecialchars($Temp['RptName'] . ' - ' . truncate_string($Temp['RptNarr'], $len = 65)) . '</option>'; } $OptionList .= '</optgroup>'; } } return $OptionList . '</select>'; }