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 } }
function print_diploma_generator($course, $cm, $a, $id) { global $CFG, $DB, $OUTPUT; $students = get_studentsincourse($course->id); if (!$students) { echo '<p>' . get_string('nostudents', 'diplome'); return NULL; } $table = new html_table(); $table->width = '60%'; $table->class = 'generaltable overviewtbale'; $table->data = array(); $table->head = array(get_string('headeruserpic', 'diplome'), get_string('headerstudent', 'diplome'), get_string('headerdownload', 'diplome'), get_string('headergenerate', 'diplome')); $table->align = array('center', 'center', 'center', 'left'); $table->size = array('', '', '', ''); $i = 0; foreach ($students as $user) { $row = array(); $row[] = $OUTPUT->user_picture($user, array('courseid' => $course->id)); $row[] = '<strong><a href="' . $CFG->wwwroot . '/user/view.php?id=' . $user->id . '&course=' . $course->id . '">' . $user->firstname . ' ' . $user->lastname . '</a></strong>'; /// Check if diploma already in database /// Set the default values for the file exists and checkbox fields $filexists = get_string('unavailable', 'diplome'); $checkbox = '<input type="checkbox" name="generate[]" value="' . $i . '"/> <input type="hidden" name="userids[]" value="' . $user->id . '"/>'; $i++; if (($diploma = $DB->get_record('diplome_diploma', array('courseid' => $course->id), 'userid', $user->id)) !== false) { $filepath = $user->id . '/' . $course->fullname . '.pdf'; if (file_exists($CFG->dataroot . '/user/d0/' . $filepath)) { $filexists = '<a href="' . $CFG->wwwroot . '/mod/diplome/download.php/' . $filepath . '">Download</a>'; } else { ///Inconsistent data base; File deleted echo '<p class="error">' . $filepath . ' : ' . get_string('certificatefiledeleted', 'diplome') . '</p>'; // delete_records('diplome_diploma', 'id', $diploma->id); } /// Allow reupload only if not already printed if ($diploma->status == 2) { $checkbox = get_string('alreadyprinted', 'diplome'); $i--; } } $row[] = $filexists; $row[] = $checkbox; $table->data[] = $row; } if ($id) { echo '<form action="view.php?id=' . $id . '&page=0" method="post">'; } else { echo '<form action="view.php?a=' . $a . '&page=0" method="post">'; } /// Print the date selector print_date_select(); /// Print the template selector print_template_select(); echo html_writer::table($table); echo '<input type="hidden" name="action" value="1"/>'; echo '<input type="submit" name="submit" value="' . get_string('generateallbutton', 'diplome') . '"/>'; echo '</form>'; }
function s_print_f() { global $user, $db, $config; ?> <tr> <td width="25" nowrap>Tipo de búsqueda:</td> <td><input type="radio" name="search_type" value="exe" onClick="showb('tb');hideb('dates');setText('t', 'Exencion');" checked />Exención <input type="radio" name="search_type" value="fact" onClick="showb('tb');hideb('dates');setText('t', 'Factura');" />Factura <input type="radio" name="search_type" value="date" onClick="showb('dates');hideb('tb');" />Fecha</td> </tr> <tr> <td colspan="2"> </td> </tr> <tbody id="tb"> <tr> <td><div id="t">Exencion</div></td> <td><input type="text" name="search" value="" /></td> </tr> </tbody> <tbody id="dates" style=" display: none;"> <tr> <td>Fecha Inicio</td> <td> <?php print_date_select(); ?> </td> </tr> <tr> <td>Fecha Final</td> <td> <?php print_date_select(true); ?> </td> </tr> </tbody> <?php }
function f_print_f() { global $db, $config, $selected; foreach (array('exencion', 'serie', 'factura', 'total', 'exento') as $var) { global ${$var}; if (!isset(${$var})) { ${$var} = ''; } } if ($selected) { $exencion = $selected; } ?> <tr> <td width="100" nowrap>Exención</td> <td><input type="text" id="exencion" name="exencion" size="25" value="<?php echo $exencion; ?> " /> <div id="s_exe" class="autocomplete darkborder" style="display: none;"></div> <script type="text/javascript"> <!-- new Ajax.Autocompleter('exencion', 's_exe', call_ajx + 'exe/', {frequency: 0.01, minChars: 6, afterUpdateElement: function() { $('serie').focus(); }}); --> </script> </td> </tr> <tr> <td>Serie</td> <td><input type="text" id="serie" name="serie" value="<?php echo $serie; ?> " size="30" /></td> </tr> <tr> <td>No. de factura</td> <td><input type="text" name="factura" value="<?php echo $factura; ?> " size="30" /></td> </tr> <tr> <td>Fecha</td> <td> <?php print_date_select(); ?> </td> </tr> <tr> <td>Total</td> <td><input type="text" name="total" value="<?php echo $total; ?> " size="30" /></td> </tr> <?php }
echo $serie != '' ? $serie : $table_data['f_serie']; ?> " size="30" /></td> </tr> <tr> <td>No. de factura</td> <td><input type="text" name="factura" value="<?php echo $factura != '' ? $factura : $table_data['f_fact']; ?> " size="30" /></td> </tr> <tr> <td>Fecha</td> <td> <?php print_date_select(); ?> </td> </tr> <tr> <td>Total</td> <td><input type="text" name="total" value="<?php echo $total ? $total : $table_data['f_total']; ?> " size="30" /></td> </tr> <?php break; } ?> </table>