/home/techb158/exp.abdallabala.com/application/controllers
NameSizeModeActions
.DS_Store61480644editdlrm
accounts.php77290644editdlrm
admin.php67330644editdlrm
ajax.date-summary.php37960644editdlrm
ajax.expense-calendar.php10310644editdlrm
ajax.income-calendar.php9970644editdlrm
api.php75950644editdlrm
appearance.php20290644editdlrm
autologin.php15990644editdlrm
board.php9890644editdlrm
calendar.php49490644editdlrm
client.php630190644editdlrm
clx_api.php431780644editdlrm
console.php57000644editdlrm
contacts.php612540644editdlrm
cp.php15570644editdlrm
customers.php970644editdlrm
dashboard-alt.php320644editdlrm
dashboard.php365810644editdlrm
default.php1420644editdlrm
delete.php96310644editdlrm
demo.php6890644editdlrm
documents.php54930644editdlrm
editor.php21490644editdlrm
export.php48740644editdlrm
files.php12430644editdlrm
generate.php14680644editdlrm
help.php3810644editdlrm
ibtest.php2110644editdlrm
index.html1120644editdlrm
invoices.php581820644editdlrm
iview.php14100644editdlrm
jsonapi.php47010644editdlrm
jsonexport.php33120644editdlrm
legacy.php250644editdlrm
login.php64400644editdlrm
logout.php800644editdlrm
orders.php88460644editdlrm
plugins.php4260644editdlrm
ps.php100160644editdlrm
quotes.php393340644editdlrm
reorder.php24040644editdlrm
reports.php262270644editdlrm
search.php21250644editdlrm
settings.php1100910644editdlrm
sys_imgcrop.php39380644editdlrm
tags.php19130644editdlrm
tax.php50240644editdlrm
transactions.php285610644editdlrm
update.php18390644editdlrm
update_473.php527630644editdlrm
util.php180270644editdlrm
Edit: /home/techb158/exp.abdallabala.com/application/controllers/documents.php (5493B)
assign('_application_menu', 'documents'); $ui->assign('_title', $_L['Documents'] . '- ' . $config['CompanyName']); $ui->assign('_st', $_L['Documents']); $action = route(1); if ($action == '') { $action = 'list'; } $user = User::_info(); $ui->assign('user', $user); Event::trigger('documents'); switch ($action) { case 'list': $ui->assign( 'jsvar', ' _L[\'are_you_sure\'] = \'' . $_L['are_you_sure'] . '\'; ' ); $upload_max_size = ini_get('upload_max_filesize'); $post_max_size = ini_get('post_max_size'); $ui->assign('upload_max_size', $upload_max_size); $ui->assign('post_max_size', $post_max_size); $ui->assign( 'xheader', Asset::css([ 'modal', 'dropzone/dropzone', 'footable/css/footable.core.min', ]) ); $ui->assign( 'xfooter', Asset::js([ 'modal', 'dropzone/dropzone', 'footable/js/footable.all.min', 'js/documents', ]) ); $xjq = ' var dl_token; $(".c_link").click(function (e) { e.preventDefault(); dl_token = $(this).attr("data-token") bootbox.prompt({ title: "' . $_L['Secure Download Link'] . '", value: "' . U . 'client/dl/" + dl_token, buttons: { \'cancel\': { label: \'' . $_L['Cancel'] . '\' }, \'confirm\': { label: \'' . $_L['OK'] . '\' } }, callback: function(result) { if (result === null) { } else { // alert(result); $.post( "' . U . 'settings/networth_goal/", { goal: result }) .done(function( data ) { location.reload(); }); } } }); }); '; $ui->assign('xjq', $xjq); $d = ORM::for_table('sys_documents')->find_array(); $ui->assign('d', $d); $ui->display('documents.tpl'); break; case 'upload': if ($_app_stage == 'Demo') { exit(); } $uploader = new Uploader(); $uploader->setDir('application/storage/docs/'); $uploader->sameName(false); // $uploader->setExtensions(array('zip')); //allowed extensions list// $uploader->allowAllFormats(); //allowed extensions list// if ($uploader->uploadFile('file')) { //txtFile is the filebrowse element name // $uploaded = $uploader->getUploadName(); //get uploaded file name, renames on upload// $file = $uploaded; $msg = $_L['Uploaded Successfully']; $success = 'Yes'; } else { //upload failed $file = ''; $msg = $uploader->getMessage(); $success = 'No'; } $a = [ 'success' => $success, 'msg' => $msg, 'file' => $file, ]; header('Content-Type: application/json'); echo json_encode($a); break; case 'post': $title = _post('title'); $file_link = _post('file_link'); $ext = pathinfo($file_link, PATHINFO_EXTENSION); $token = Ib_Str::random_string(30); if ($title == '' || $file_link == '') { ib_die($_L['All Fields are Required']); } $d = ORM::for_table('sys_documents')->create(); $d->title = $title; $d->file_path = $file_link; $d->file_dl_token = $token; $d->file_mime_type = $ext; $d->created_at = date('Y-m-d H:i:s'); $d->save(); echo $d->id(); break; case 'view': $id = route(2); $doc = ORM::for_table('sys_documents')->find_one($id); if ($doc) { $ext = pathinfo($doc->file_path, PATHINFO_EXTENSION); $ui->assign('ext', $ext); $ui->assign('doc', $doc); $ui->display('documents_view.tpl'); } else { i_close('Not Found'); } break; case 'download': $id = route(2); $doc = ORM::for_table('sys_documents')->find_one($id); if ($doc) { $file = 'application/storage/docs/' . $doc->file_path; $c_type = mime_content_type($file); if (file_exists($file)) { $basename = basename($file); $mime = mime_content_type($file); $size = filesize($file); $fp = fopen($file, "rb"); if (!($mime && $size && $fp)) { return; } header("Content-type: " . $mime); header("Content-Length: " . $size); header( "Content-Disposition: attachment; filename=" . $basename ); header('Content-Transfer-Encoding: binary'); header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' ); fpassthru($fp); } } else { i_close('Not Found'); } break; default: echo 'action not defined'; }