?> "><?php echo __('Choose Building', 'idp-plugin'); ?> </label> <input id="cb-select-<?php echo $building["id"]; ?> " type="checkbox" name="buildings[]" value="<?php echo $building["id"]; ?> "> </th> <td class="has-row-actions column-primary column-col_building_adress"> <?php echo Idp_Admin::getBuildingAddress($building["id"]); ?> <div class="row-actions"> <span><a href="<?php echo get_page_link(40) . "?buildingid=" . $building['id']; ?> "><?php echo __('Show', 'idp-plugin'); ?> </a></span> </div> </td> <td class="column-col_building_student"> <?php echo $building["student"];
function compressPDFFiles() { require_once IDP__PLUGIN_DIR . '/admin/class.idp-admin.php'; $path = parse_url(content_url("pdf")); $pdf_directory = ABSPATH . ltrim($path['path'], '/'); Idp_Admin::generateZipFile($pdf_directory, true); }
public static function generateZipFile($pdf_directory, $delete_files) { if (Idp_Admin::getPDFCount($pdf_directory) == 0) { return false; } $zip = new ZipArchive(); date_default_timezone_set("Europe/Berlin"); $date = date("Y_m_d_H_i"); $filename = $pdf_directory . "/" . $date . ".zip"; if ($zip->open($filename, ZipArchive::CREATE) !== TRUE) { exit("cannot open <{$filename}>\n"); } foreach (glob($pdf_directory . "/*.pdf") as $file) { $filename_in_zip = substr($file, strrpos($file, '/') + 1); $zip->addFile($file, $filename_in_zip); } $zip->close(); if ($delete_files) { array_map('unlink', glob($pdf_directory . "/*.pdf")); } if (file_exists($filename)) { return $date . ".zip"; } else { return false; } }
?> </span> <span class="toggle-indicator" aria-hidden="true"></span> </button> <h2 class="hndle ui-sortable-handle"> <span><?php echo __('PDF manager', 'idp-plugin'); ?> </span> </h2> <div class="inside"> <div class="main"> <ul> <li class="post-count"> <b><?php echo Idp_Admin::getPDFCount($pdf_directory) . " " . __('pdf file(s) found.', 'idp-plugin'); ?> </b><br/> </li> </ul> <p> <span> <?php echo __('Next time pdf files will automatically compressed: ', 'idp-plugin'); ?> <strong> <?php echo strftime("%A %H:%M", wp_next_scheduled('compress_pdf_files')); ?> </strong> <br />
$current_owner = get_user_by('id', $building->update_user); } foreach ($students as $student) { $selected = ""; if ($current_owner->ID == $student->ID) { $selected = "selected = \"selected\""; } ?> <option value="<?php echo $building->id . "-" . $student->ID; ?> "<?php echo $selected; ?> ><?php echo Idp_Admin::getUserDisplayName($student); ?> </option> <?php } if (count($students) == 0) { ?> <option disabled="disabled" selected="selected"> <?php _e('No student available.', 'idp-plugin'); ?> </option> <?php } ?>
</option> <?php } ?> </select> </td> </tr> <tr> <th><label for="attribute_input_type"><?php echo __('Input Type', 'idp-plugin'); ?> </label></th> <td> <select name="attribute_input_type" id="attribute_input_type"> <?php $input_types = Idp_Admin::getInputTypes(); foreach ($input_types as $input_type) { ?> <option value="<?php echo $input_type->id; ?> "><?php echo $input_type->name; ?> </option> <?php } ?> </select> </td> </tr>