public function itemProps($itemId) { $itemId = trim($itemId, '/\\'); if ($this->fs->allow($itemId, $real)) { return array_merge(parent::itemProps($itemId), array('inode' => $this->hasChildren($real, $icon), 'icon' => $icon, 'size' => is_file($real) ? formatSizeUnits(filesize($real)) : '', 'type' => recongnizeType($real), 'random' => mt_rand(0, 99))); } return parent::itemProps($itemId); }
function detail() { $id = $_GET['id']; $where = "id = '" . $id . "' AND n_status = '1'"; $data = $this->models->getData(TRUE, '*', 'floraINA_digirepo', $where); //pr($data); if ($data) { foreach ($data as $key => $value) { $data[$key]['content'] = html_entity_decode($value['content'], ENT_QUOTES, 'UTF-8'); $data[$key]['filesize'] = formatSizeUnits($value['filesize']); } $this->view->assign('data', $data); } return $this->loadView('digirepo/reference_detail'); }
?> </div> <div id="content2"> <h1><?php echo t('menu.main.agb'); ?> </h1> <p><?php echo t('page.agb.line1'); ?> </p> <p><a href="<?php echo $agb_pdf_filepath; ?> " target="_blank"><?php echo substr($agb_pdf_filename, 7) . ' (' . formatSizeUnits(filesize($agb_pdf_filepath), 1) . ')'; ?> </a></p> </div> <div id="nebennavigation"><div id="nebennavigationinnen"><?php include 'inc/nebennavigation.php'; ?> </div> </div></div> </div> </body> </html> <?php $thread_id = mysqli_thread_id($link); mysqli_kill($link, $thread_id);
?> ?id=<?php echo $post->post_author; ?> "> <?php $wp = get_userdata($post->post_author); echo $wp->display_name; ?> </a> </div> </td> <td class="filesizetotal"> <?php $meta = get_post_meta($post->ID, '_wp_collaboration_file_size', true); echo formatSizeUnits($meta); ?> </td> <td class="fileslistoptions"> <div class="wrlistitemactionsholder"> <div class="fileslistoptionstxt wrlistitemactionstxt"> Options </div> <ul class="fileslistoptionsitems writemactionslist"> <li class="first"><a href="javascript:void(0);" data-file-id='<?php echo $post->ID; ?> ' data-file-name="<?php echo $post->post_title; ?> " onClick="JavaScript:Edd.collaboration.FILES.DOWNLOAD_FILES(this);">Download File</a></li>
<div class="box-notice iconFile <?php echo $iconType; ?> "> <div class="box-text"> <p class="text-title"><? echo $row['CONTENT_DESC'] ?></p> <p class="text-detail"> <span><?php echo $typeCap; ?> : <? echo getEXT($IMG_PATH) ?></span> <span><?php echo $sizeCap; ?> : <?php echo formatSizeUnits(filesize($IMG_PATH)); ?> </span> </p> </div> <div class="box-btn cf"> <a href="<?php echo $IMG_PATH; ?> " target="_blank" class="btn red"><?php echo $downloadCap; ?> </a> </div> </div>
function uploadAjax() { global $basedomain; $output_dir = $basedomain . "public_assets/tmp/"; if (isset($_FILES["myfile"])) { $ret = array(); // This is for custom errors; /* $custom_error= array(); $custom_error['jquery-upload-file-error']="File already exists"; echo json_encode($custom_error); die(); */ $error = $_FILES["myfile"]["error"]; //You need to handle both cases //If Any browser does not support serializing of multiple files using FormData() if (!is_array($_FILES["myfile"]["name"])) { $upload = uploadFile('myfile', 'tmp'); $ret[0] = $upload['full_name']; $ret[1] = $upload['real_name']; $ret[2] = formatSizeUnits($_FILES["myfile"]["size"]); } else { $fileCount = count($_FILES["myfile"]["name"]); for ($i = 0; $i < $fileCount; $i++) { $upload = uploadFile('myfile', 'tmp'); $ret[0] = $upload['full_name']; $ret[1] = $upload['real_name']; $ret[2] = formatSizeUnits($_FILES["myfile"]["size"]); } } echo json_encode($ret); exit; } }
<?php $path = "../admin_digilib/files/"; $filesize = filesize($path); $filesizex = formatSizeUnits($filesize); include "../admin_digilib/config/koneksi.php"; error_reporting(E_ALL ^ E_NOTICE); session_start(); $member_id = $_SESSION['member_id']; if (empty($_SESSION['member_id'])) { header('location:../login_member.php'); } $result = mysql_query("SELECT * from digilib_ebook"); function formatSizeUnits($bytes) { if ($bytes >= 1073741824) { $bytes = number_format($bytes / 1073741824, 2) . ' GB'; } elseif ($bytes >= 1048576) { $bytes = number_format($bytes / 1048576, 2) . ' MB'; } elseif ($bytes >= 1024) { $bytes = number_format($bytes / 1024, 2) . ' KB'; } elseif ($bytes > 1) { $bytes = $bytes . ' B'; } elseif ($bytes == 1) { $bytes = $bytes . ' B'; } else { $bytes = '0 B'; } return $bytes; } ?>
<?php foreach ($files as $one) { ?> <tr> <td><i class="fa <?php echo font_awesome_file_icon_class($one->myme_type); ?> "></i></td> <td><strong><?php echo $one->name; ?> </strong></td> <td>Файл</td> <td><?php echo formatSizeUnits($one->size); ?> </td> <td><?php echo date('d.m.Y', strtotime($one->create_date)); ?> </td> <td> <a href="#"><i class="fa fa-eye"></i></a> <a href="#"><i class="fa fa-link"></i></a> <a href="#"><i class="fa fa-trash"></i></a> </td> </tr> <?php }
<div class="col-sm-4"> <div class="ih-item square effect3 bottom_to_top" style="background-color: #bdc3c7;"><a> <div class="img"><img src="<?php echo $file; ?> " alt="<?php echo $file; ?> "></div> <div class="info"> <h3><?php echo basename($file); ?> </h3> <p>Taille : <?php echo formatSizeUnits(filesize($file)); ?> <button type="submit" class="btn btn-danger btn-modal" value="<?php echo basename($file); ?> " data-toggle="modal" data-target="#deleteModal"> <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> </button></p> </div></a></div> </div> <?php } ?> </div>
the_content(); ?> </div> <?php if ($meta[attached_file][0] != '') { ?> <div class="doc_cont"> <?php $filename = $meta[attached_file][0]; $explode = explode('/', $meta[attached_file][0]); $cv_format = end($explode); $explode_dot = explode('.', $cv_format); $extention = end($explode_dot); $headers = get_headers($filename, 1); $fsize = $headers['Content-Length']; $mbytes = formatSizeUnits($fsize); ?> <?php if ($extention == 'docx' or $extention == 'doc') { ?> <img src="<?php echo get_bloginfo('url') . '/wp-content/themes/cafemocha/custom-images/word_icon.png'; ?> " /> <?php } else { if ($extention == 'pdf') { ?> <img src="<?php echo get_bloginfo('url') . '/wp-content/themes/cafemocha/custom-images/file_pdf.png'; ?>
$hasil = $koneksi_db->sql_query("SELECT * FROM tugassiswa where tugas='{$idtugas}' order by id desc"); $admin .= '<div class="panel-heading"><b>Data Tugas</b></div>'; $admin .= '<table id="example" class="table table-striped table-hover"> <thead><tr> <th width="20px">No</th> <th>Nama</th> <th>Kelas</th> <th>Aksi</th> </tr></thead><tbody>'; $no = 1; while ($data = $koneksi_db->sql_fetchrow($hasil)) { $nama = $data['nama']; $kelas = $data['kelas']; $file = $data['file']; $ukuranfile = filesize('mod/tugas/download/' . $file . ''); $ukuranfile = formatSizeUnits($ukuranfile); $detailbutton = '<a href="?pilih=tugas&mod=yes&aksi=detail&id=' . $data['id'] . '"><span class="btn btn-success">Detail</span></a>'; $admin .= '<tr> <td><b>' . $no . '</b></td> <td>' . $nama . '</td> <td>' . $kelas . '</td> <td>' . $detailbutton . '</td> </tr>'; $no++; } $admin .= '</tbody></table>'; } if ($_GET['aksi'] == "detail") { $admin .= '<div class="panel-heading"><b>Data Tugas</b></div>'; $id = int_filter($_GET['id']); $query = mysql_query("SELECT * FROM `tugassiswa` WHERE `id`='{$id}'");
function get_workroom_space_details($Workroom_Id) { $total_files = get_files($Workroom_Id); $size = 0; foreach ($total_files as $file) { $size = $size + get_post_meta($file->ID, '_wp_collaboration_file_size', true); } $available_size = (int) get_option('allowed_space_in_gb'); $available_size_in_kb = $available_size * 1000000000; $free_space = $available_size_in_kb - ($available_size_in_kb - $size); $dp = sprintf('%.2f', $free_space / $available_size_in_kb * 100); return array('UsedSpace' => $size, 'UsedSpaceWithUnit' => formatSizeUnits($size), 'UsedSpaceWithPercentage' => $dp, 'TotalSpace' => formatSizeUnits($available_size_in_kb)); }
if ($bytes >= 1073741824) { $bytes = number_format($bytes / 1073741824, 2) . ' GB'; } elseif ($bytes >= 1048576) { $bytes = number_format($bytes / 1048576, 2) . ' MB'; } elseif ($bytes >= 1024) { $bytes = number_format($bytes / 1024, 2) . ' KB'; } elseif ($bytes > 1) { $bytes = round($bytes / 1024, 3) . ' KB'; } elseif ($bytes == 1) { $bytes = $bytes . ' byte'; } else { $bytes = '0 bytes'; } return $bytes; } echo "Bestandsgrootte: " . formatSizeUnits(filesize($dir . "\\" . $bestandsnaam)) . "<br />"; //Laatste bewerkt: $tijd = date("d F Y - H:i:s", filemtime($map . "\\" . $bestandsnaam)); echo "Laatst aangepast: " . $tijd . "<br />"; //Images uit de map if ($bestandext == "gif") { echo '<img src="' . $bestandsnaam . '">'; } // Bestanden aangeven if ($bestandext == "jpg" || $bestandext == "png" || $bestandext == "jpeg") { $afbeelding = $dir . $bestandsnaam; $afbeelding = str_replace(getcwd(), "", $afbeelding); $afbeelding = ltrim($afbeelding, '\\'); echo '<img src="' . $afbeelding . '">'; } if ($bestandext == "php" || $bestandext == "txt" || $bestandext == "css") {
if (preg_match('/monthly_history = (.*?);/mis', $output, $matches, PREG_OFFSET_CAPTURE)) { $monthly_results = parse_js_array($matches[1][0]); } // close curl resource to free up system resources curl_close($ch); echo "\${color #B8FF00}Monthly Bandwidth Usage\${color white}\n"; foreach (array_reverse($monthly_results) as $k => $result) { if ($k >= 3) { break; } if ($k == 0) { echo '${font Bitstream Vera:size=10:style=Bold}'; } else { echo '${font Bitstream Vera:size=10}'; } $date = date("F", strtotime($result[0] . "+ 1 day")); echo sprintf("%-25s \${alignr}%-12s \${alignr}%s\n", $date, formatSizeUnits($result[1]), formatSizeUnits($result[2])); } echo "\n\${color #B8FF00}Daily Bandwidth Usage\${color white}\n"; foreach (array_reverse($daily_results) as $k => $result) { if ($k >= 3) { break; } if ($k == 0) { echo '${font Bitstream Vera:size=10:style=Bold}'; } else { echo '${font Bitstream Vera:size=10}'; } $date = date("F jS", strtotime($result[0])); echo sprintf("%-25s \${alignr}%-12s \${alignr}%s\n", $date, formatSizeUnits($result[1]), formatSizeUnits($result[2])); }
<?php if (have_posts()) { while (have_posts()) { the_post(); the_content(); } } ?> <div class="clearfix"></div> <?php $research_pdf = get_post_meta($post->ID, 'authors_section_pdf', true); $pdf_id = get_pdf_id($research_pdf); $file_path = filesize(get_attached_file($pdf_id)); $pdf_size = $file_path; if (!empty($research_pdf)) { echo '<a class="button float-right bottom-spacing" target="_blank" href="' . $research_pdf . '">View (PDF, ' . formatSizeUnits($pdf_size) . ')</a>'; } ?> </div> <!-- Research ends here--> </div> <?php //sidebar comes here get_sidebar(); ?> </div> </div> <?php get_footer();
<td><input type="text" name="judul" value="' . $data['tglakhir'] . '" size="25"class="form-control" disabled></td> </tr> </table> '; $hasil = $koneksi_db->sql_query("SELECT * FROM tugassiswa where tugas='{$idtugas}' order by id desc"); $admin .= '<div class="panel-heading"><b>Data Tugas</b></div>'; $admin .= '<table id="example" class="table table-striped table-hover"> <thead><tr> <th width="20px">No</th> <th>Nama</th> <th>Kelas</th> <th>File</th> </tr></thead><tbody>'; $no = 1; while ($data = $koneksi_db->sql_fetchrow($hasil)) { $nama = $data['nama']; $kelas = $data['kelas']; $file = $data['file']; $ukuranfile = filesize('mod/tugas/download/' . $file . ''); $admin .= '<tr> <td><b>' . $no . '</b></td> <td>' . $nama . '</td> <td>' . $kelas . '</td> <td>' . $file . ' (' . formatSizeUnits($ukuranfile) . ')</td> </tr>'; $no++; } $admin .= '</tbody></table>'; } $admin .= '</div>'; echo $admin;
</td> <td width="10%"> <a href="" class="transparent change-folder" title="Change Name" rel="' . $c['name'] . '"><i class="icon-pencil"></i></a> <a href="" class="transparent delete-folder" rel="' . urlencode($c['path']) . '" title="Delete"><i class="icon-trash"></i></a> </td> </tr>'; } else { $html .= '<tr> <td> <i class="icon-picture"></i> <a href="" class="img-thumbs" rel="' . $c['path'] . '" title="' . $c['name'] . '"> ' . TrimText($c['name'], 50) . ' </a> </td> <td width="20%"> ' . formatSizeUnits($c['s']) . ' </td> <td width="10%"> <a href="" class="transparent change-file" title="Change Name" rel="' . $c['name'] . '"><i class="icon-pencil"></i></a> <a href="" class="transparent delete-file" rel="' . urlencode($c['p']) . '" title="Delete"><i class="icon-trash"></i></a> </td> </tr>'; } } else { if ($c['is_file'] == false) { $html .= '<div class="item"> <a class="lib-folder" href="" rel="' . urlencode($c['path']) . '" title="' . $c['name'] . '"> <img src="bootstrap/img/130x90.png" class="img-polaroid" width="130" height="90"> </a> <div> <a href="" class="pull-left transparent change-folder" title="Change Name" rel="' . $c['name'] . '"><i class="icon-pencil"></i></a>
function fmenu($if) { $acc = new Account(); $acc->getByID($if->file_author); $path = _SPPATH . $if->upload_url; $fil = $if->file_filename; ?> <div class="col-md-4"> <h3 class="h3pv" style="width: 100%; overflow: hidden;"><?php echo $if->file_url; ?> </h3> <div class="metadata"><?php echo Lang::t('Author'); ?> : <?php echo $acc->admin_nama_depan; ?> </div> <div class="metadata"><?php echo Lang::t('Size'); ?> : <?php echo formatSizeUnits($if->file_size); ?> </div> <div class="metadata"><?php echo Lang::t('Date'); ?> : <?php echo indonesian_date($if->file_date); ?> </div> <?php $inp = new \Leap\View\InputFile(); if (in_array($if->file_ext, $inp->arrVideoExt)) { ?> <!-- <div class="metadata">Embed Code : <br/>--><?php //= '#tbs_video#' . _BPATH . $if->upload_url . $if->file_filename . // '#/tbs_video#' ?> <!--</div>--> <div class="clone-url open" data-protocol-type="subversion" data-url="/users/set_protocol?protocol_selector=subversion&protocol_type=clone"> Embed Code : <div class="input-group js-zeroclipboard-container"> <input type="text" class="input-mini input-monospace js-url-field js-zeroclipboard-target" value="<?php echo '#tbs_video#' . _BPATH . $if->upload_url . $if->file_filename . '#/tbs_video#'; ?> " readonly="readonly" /> </div> </div> <?php } ?> <?php if ($if->file_ext == "pdf") { ?> <?php /*<button style="margin-top: 10px;" onclick="window.open('<?= _SPPATH; ?>js/ViewerJS/leappdf.php?nn=<?= $if->file_url; ?>&dd=<?= $if->bolehsave; ?>#<?= base64_encode($path . $if->file_filename); ?>.pdf','_blank');" class="btn btn-primary"><?= Lang::t('Open'); ?></button>*/ ?> <?php } else { ?> <button style="margin-top: 10px;" onclick="window.open('<?php echo $path . $fil; ?> ','_blank');" class="btn btn-primary"><?php echo Lang::t('Open'); ?> </button> <?php } //pr($if); ?> </div> <?php }
/** * Log the current average memory usage per completed request * * @return string */ private function logAvgMemoryUsage() { return formatSizeUnits($this->logMemoryUsage() / $this->countCompleted()); }
function crear() { set_time_limit(0); $ruta = "musica"; $GLOBALS['contador'] = 1; //Empesamos la estructura del archivo xml $xml = new DomDocument('1.0'); $playlist = $xml->createElement('albumList'); $playlist = $xml->appendChild($playlist); // comprobamos si lo que nos pasan es un direcotrio if (is_dir($ruta)) { // Abrimos el directorio y comprobamos que if ($aux = opendir($ruta)) { while (($archivo = readdir($aux)) !== false) { // Si quisieramos mostrar todo el contenido del directorio pondrÃÂamos lo siguiente: // echo '<br />' . $file . '<br />'; // Pero como lo que queremos es mostrar todos los archivos excepto "." y ".." if ($archivo != "." && $archivo != "..") { $ruta_completa = $ruta . '/' . $archivo; //echo "Esto: ".$ruta_completa."<br>"; if (is_dir($ruta_completa)) { // Abrimos la nueva carpeta, esta sera el nombre del album if ($aux2 = opendir($ruta_completa)) { //echo "Folder: ".$archivo."<br>"; //Aui se empiezan a crear los albums $libro = $xml->createElement('album'); //se empieza a iterar desde el album $libro = $playlist->appendChild($libro); $autor = $xml->createElement('albumID', "{$GLOBALS['contador']}"); $autor = $libro->appendChild($autor); $titulo = $xml->createElement('albumTitle', htmlspecialchars(utf8_encode($archivo))); $titulo = $libro->appendChild($titulo); $anio = $xml->createElement('albumArtist', 'unknown'); $anio = $libro->appendChild($anio); //$albumFolder = $xml->createElement('albumFolder','../data/ACDC/Back In Black/');//No se aun que es esto,parece ser la ubicacion de las imagenes $albumFolder = $xml->createElement('albumFolder', '/images'); $albumFolder = $libro->appendChild($albumFolder); $albumTracks = $xml->createElement('albumTracks'); //Empieza la lista de canciones $albumTracks = $libro->appendChild($albumTracks); $no_cancion = 1; while (($archivo2 = readdir($aux2)) !== false) { if ($archivo2 != "." && $archivo != "..") { $ruta_completa2 = $ruta_completa . '/' . $archivo2; if (is_dir($ruta_completa2)) { } else { if (substr("{$ruta_completa2}", -3, 3) == "mp3") { //El sistema solo soporta archivos con expencion mp3 $track = $xml->createElement('track'); $track = $albumTracks->appendChild($track); $trackID = $xml->createElement('trackID', "{$no_cancion}"); $trackID = $track->appendChild($trackID); $trackFile = $xml->createElement('trackFile', htmlspecialchars(utf8_encode($ruta_completa2))); //Ubicacion del archivo $trackFile = $track->appendChild($trackFile); $trackTitle = $xml->createElement('trackTitle', htmlspecialchars(utf8_encode($archivo2))); //Nombre del archivo $trackTitle = $track->appendChild($trackTitle); $trackArtist = $xml->createElement('trackArtist', "Unknow"); $trackArtist = $track->appendChild($trackArtist); //Calcular el timpo de la cancion $mp3file = new MP3File(htmlspecialchars($ruta_completa2)); $duration2 = $mp3file->getDuration(); //(slower) for VBR (or CBR) $trackLengh = $xml->createElement('trackLengh', MP3File::formatTime($duration2)); $trackLengh = $track->appendChild($trackLengh); $trackFileSize = $xml->createElement('trackFileSize', formatSizeUnits(filesize(htmlspecialchars($ruta_completa2)))); //Tamaño del archivo $trackFileSize = $track->appendChild($trackFileSize); //echo "Ubicacion del archivo: ".$ruta_completa2."<br>"; $GLOBALS['contador']++; $no_cancion++; } } //Termina else carga de archivos } } //Esto va despues del while $albumTracksCount = $xml->createElement('albumTracksCount', $no_cancion - 1); $albumTracksCount = $libro->appendChild($albumTracksCount); $no_cancion = 1; $albumCover = $xml->createElement('albumCover', "images/disco.jpg"); $albumCover = $libro->appendChild($albumCover); closedir($aux2); } } else { //No son carpetas, por lo tanto no mostramos nada } } } closedir($aux); } } //Creamos el archivo $xml->formatOutput = true; $el_xml = $xml->saveXML(); $xml->save('xml/playlistAllAlbums.xml'); }
$numFile = mysql_num_rows($QueryFile); if($numFile > 0){ ?> <div class="box-otherfile-main"> <div class="box-title cf"> <h2>ไฟล์อื่นๆที่เกี่ยวข้อง</h2> </div> <div class="box-news-main gray"> <?php while ($rowFile = mysql_fetch_array($QueryFile)) { $file = str_replace("../../","",$rowFile['IMG_PATH']); if((file_exists($file)) OR ($rowFile['IMG_TYPE'] == 4)){ $ext = getEXT($file); if(file_exists($file)){ $size = formatSizeUnits(filesize($file)); $link = 'download.php?p='.$rowFile['PIC_ID']; }else{ $size = 'Unknow'; $link = $rowFile['IMG_PATH']; } ?> <div class="box-notice iconFile <?=returnFileType($ext) ?>"> <div class="box-text"> <p class="text-title"><?=$rowFile['IMG_NAME'] ?></p> <p class="text-detail"> <span><?=$typeCap ?>: .<?=$ext ?></span> <span><?=$sizeCap ?>: <?=$size ?></span> </p> </div> <div class="box-btn cf">
<?php if ($format == 'xlsx') { $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); } if ($format == 'xls') { $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); } if ($format == 'csv') { $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'CSV')->setDelimiter(';')->setEnclosure('"')->setLineEnding("\r\n")->setSheetIndex(0); require_once '../../PHPExcel/Classes/PHPExcel/Shared/String.php'; PHPExcel_Shared_String::setDecimalSeparator(','); PHPExcel_Shared_String::setThousandsSeparator('.'); } $objWriter->save($filename); chmod($filename, 0777); while (!file_exists($filename)) { sleep(1); } if ($format === 'csv') { print '<br><img src=../images/csv.gif class=downloadimage><a href="../temp/' . $rand . '.' . $format . '">Open csv-bestand</a> (' . formatSizeUnits(filesize($filename)) . ')'; } else { print '<br><img src=../images/excel.gif class=downloadimage><a href="../../temp/' . $rand . '.' . $format . '">Open Excel-bestand</a> (' . formatSizeUnits(filesize($filename)) . ')'; } ?> <script type="text/javascript"> $(document).ready(function() { $('#download').css({'background-image':'none'}); }); </script>