Ejemplo n.º 1
0
 /**
  * Test the URL::to_asset method.
  *
  * @group laravel
  */
 public function testToAssetGeneratesURLWithoutFrontControllerInURL()
 {
     $this->assertEquals('http://localhost/image.jpg', URL::to_asset('image.jpg'));
     $this->assertEquals('https://localhost/image.jpg', URL::to_asset('image.jpg', true));
     Config::set('application.index', '');
     $this->assertEquals('http://localhost/image.jpg', URL::to_asset('image.jpg'));
     $this->assertEquals('https://localhost/image.jpg', URL::to_asset('image.jpg', true));
     Request::foundation()->server->add(array('HTTPS' => 'on'));
     $this->assertEquals('https://localhost/image.jpg', URL::to_asset('image.jpg'));
 }
Ejemplo n.º 2
0
function assetPath($url)
{
    $url = asset($url);
    $base = rtrim(\URL::to_asset(''), '/') . '/';
    if (S::unprefix($url, $base)) {
        if (strtok($url, '/') === 'bundles') {
            $bundle = strtok('/');
            $path = strtok(null);
            return \Bundle::path($bundle) . 'public' . DS . ltrim($path, '\\/');
        } else {
            return \path('public') . ltrim($url, '\\/');
        }
    }
}
Ejemplo n.º 3
0
            <tr>
                <th><?php 
echo __('tinyissue.image');
?>
</th>
                <td>
                    <input type="file"  value="<?php 
echo Input::old('image');
?>
"  name="image"  /><br/><br/>
                    <img height="50px" src="<?php 
if (Project::current()->image != '') {
    echo URL::to_asset(Project::current()->image);
} else {
    echo URL::to_asset('uploads/project/projectDefault.png');
}
?>
" />
                </td>
            </tr>

			<tr>
				<th><?php 
echo __('tinyissue.status');
?>
</th>
				<td><?php 
echo Form::select('status', array(1 => 'Open', 0 => 'Archived'), Project::current()->status);
?>
</td>
Ejemplo n.º 4
0
<?php

echo render('includes.header');
echo render('includes.navbar');
?>

<div class="container" id="content">

<div class="row">
<div class="span">
  <div class="image-place" style="display:none">
    <div class="image-holder">
    <img src="<?php 
echo URL::to_asset('images/' . $galleryID . '/' . $image->name);
?>
">
  </div>
  <div class="image-bar">
    <div class="image-stat"><i class="icon-eye-open"></i> <?php 
echo $image->views;
?>
</div>
    <div class="image-stat"><i class="icon-heart"></i> <?php 
echo $image->likes;
?>
</div>
    <div class="pull-right">
      <?php 
if ($liked) {
    ?>
        <button class="btn btn-danger" type="button" disabled><i class="icon-heart icon-white"></i> Liked!</button>
Ejemplo n.º 5
0
 private function fetch_modpack($slug)
 {
     $response = array();
     if (Cache::has('modpack.' . $slug) && empty($this->client)) {
         $modpack = Cache::get('modpack.' . $slug);
     } else {
         $modpack = Modpack::with('Builds')->where("slug", "=", $slug)->first();
         if (empty($this->client)) {
             Cache::put('modpack.' . $slug, $modpack, 5);
         }
     }
     if (empty($modpack)) {
         return array("error" => "Modpack does not exist");
     }
     $response['name'] = $modpack->slug;
     $response['display_name'] = $modpack->name;
     $response['url'] = $modpack->url;
     $resourcePath = URL::to_asset('resources/' . $modpack->slug);
     if ($modpack->icon == 0 && !empty($modpack->icon_md5)) {
         $response['icon'] = Config::get('solder.mirror_url') . $modpack->slug . "/resources/icon.png";
     } else {
         if ($modpack->icon == 0 && empty($modpack->icon_md5)) {
             $response['icon'] = URL::to_asset('resources/default/icon.png');
             $modpack->icon_md5 = md5_file(path('public') . 'resources/default/icon.png');
         } else {
             if (Config::get('solder.use_s3')) {
                 $response['icon'] = Config::get('solder.s3_url') . 'resources/' . $modpack->slug . '/icon.png?' . TimeUtils::getTimestampDate($modpack->updated_at);
             } else {
                 $response['icon'] = $resourcePath . "/icon.png";
             }
         }
     }
     $response['icon_md5'] = $modpack->icon_md5;
     if ($modpack->logo == 0 && !empty($modpack->logo_md5)) {
         $response['logo'] = Config::get('solder.mirror_url') . $modpack->slug . "/resources/logo.png";
     } else {
         if ($modpack->logo == 0 && empty($modpack->logo_md5)) {
             $response['logo'] = URL::to_asset('resources/default/logo.png');
             $modpack->logo_md5 = md5_file(path('public') . 'resources/default/logo.png');
         } else {
             if (Config::get('solder.use_s3')) {
                 $response['logo'] = Config::get('solder.s3_url') . 'resources/' . $modpack->slug . '/logo.png?' . TimeUtils::getTimestampDate($modpack->updated_at);
             } else {
                 $response['logo'] = $resourcePath . "/logo.png";
             }
         }
     }
     $response['logo_md5'] = $modpack->logo_md5;
     if ($modpack->background == 0 && !empty($modpack->background_md5)) {
         $response['background'] = Config::get('solder.mirror_url') . $modpack->slug . "/resources/background.png";
     } else {
         if ($modpack->background == 0 && empty($modpack->background_md5)) {
             $response['background'] = URL::to_asset('resources/default/background.png');
             $modpack->background_md5 = md5_file(path('public') . 'resources/default/background.png');
         } else {
             if (Config::get('solder.use_s3')) {
                 $response['background'] = Config::get('solder.s3_url') . 'resources/' . $modpack->slug . '/background.png?' . TimeUtils::getTimestampDate($modpack->updated_at);
             } else {
                 $response['background'] = $resourcePath . "/background.png";
             }
         }
     }
     $response['background_md5'] = $modpack->background_md5;
     $response['recommended'] = $modpack->recommended;
     $response['latest'] = $modpack->latest;
     $response['builds'] = array();
     foreach ($modpack->builds as $build) {
         if ($build->is_published) {
             if (!$build->private) {
                 array_push($response['builds'], $build->version);
             } else {
                 if (isset($this->client)) {
                     foreach ($this->client->modpacks as $pmodpack) {
                         if ($modpack->id == $pmodpack->id) {
                             array_push($response['builds'], $build->version);
                         }
                     }
                 }
             }
         }
     }
     return $response;
 }
Ejemplo n.º 6
0
 /**
  * Create a HTML image input element.
  *
  * <code>
  *		// Create an image input element
  *		echo Form::image('img/submit.png');
  * </code>
  *
  * @param  string  $url
  * @param  string  $name
  * @param  array   $attributes
  * @return string
  */
 public static function image($url, $name = null, $attributes = array())
 {
     $attributes['src'] = URL::to_asset($url);
     return static::input('image', $name, null, $attributes);
 }
Ejemplo n.º 7
0
?>
  <style>
    body {
      padding-top: 60px;
      padding-bottom: 20px;
    }
  </style>
  <?php 
echo HTML::style('css/bootstrap-responsive.css');
?>
  <?php 
echo HTML::style('css/juballery.css');
?>
  <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]-->
  <!-- Fav and touch icons -->
  <?php 
echo HTML::script('js/jquery.js');
?>
  <?php 
echo HTML::script('js/bootstrap.js');
?>
  <link rel="shortcut icon" href="<?php 
echo URL::to_asset('favicon.ico');
?>
">
</head>
<body>
Ejemplo n.º 8
0
 /**
  * Return the URL to the asset route container.
  * 
  * @param  string  $route
  * @return string
  */
 public static function show($route)
 {
     $methods = array('css' => 'style', 'js' => 'script');
     // If the container is set to development mode then Basset will show all the assets that have been added
     // up until now. This may be a problem if assets are added after the template view is rendered, however
     // this is acceptable. Assets should be added as early as possible during the application logic.
     $container = static::$routes[Bundle::option('basset', 'handles') . '/' . $route];
     if ($container->config->get('development')) {
         $response = '<!-- BASSET NOTICE: Some assets may not be displayed depending on where they were set during the application flow. -->';
         return $response . PHP_EOL . $container->compile();
     }
     return HTML::$methods[File::extension($route)](URL::to_asset(Bundle::option('basset', 'handles') . '/' . $route));
 }
Ejemplo n.º 9
0
    </div>
  <?php 
}
?>

  <div class="container" id="content">
    <?php 
echo Section::yield('content');
?>
  </div>

  <script>
      var dojoConfig = {
          async: 1,
          baseUrl: "<?php 
echo URL::to_asset('js/dojo');
?>
",
          packages: [
              { name: "bootstrap", location: "Dojo-Bootstrap" },
              { name: "clementia", location: "clementia" }
          ]
      };
  </script>

  <?php 
echo Asset::container('footer')->scripts();
?>
  <?php 
echo Section::yield('additional_footer_content');
?>
Ejemplo n.º 10
0
    }
    /**
     * Gets an array of tages to be excluded from
     * the elcude param
     * @param int $exclude What to gets excluded from i.e. SBBCodeParser_BBCode::AUTO_DETECT_EXCLUDE_EMOTICON
     * @return array
     */
    private function get_excluded_tags($exclude)
    {
        $ret = array();
        foreach ($this->bbcodes as $bbcode) {
            if ($bbcode->auto_detect_exclude() & $exclude) {
                $ret[] = $bbcode->tag();
            }
        }
        return $ret;
    }
}
IoC::singleton('BBCodeDocParser', function () {
    $instance = new SBBCodeParser_Document();
    $instance->add_emoticons(array(":)" => URL::to_asset('bundles/forums/emoticons/smile.png'), "=)" => URL::to_asset('bundles/forums/emoticons/smile.png'), "=]" => URL::to_asset('bundles/forums/emoticons/smile.png'), ":angel:" => URL::to_asset('bundles/forums/emoticons/angel.png'), ":angry:" => URL::to_asset('bundles/forums/emoticons/angry.png'), "8-)" => URL::to_asset('bundles/forums/emoticons/cool.png'), ":'(" => URL::to_asset('bundles/forums/emoticons/cwy.png'), "='(" => URL::to_asset('bundles/forums/emoticons/cwy.png'), "='[" => URL::to_asset('bundles/forums/emoticons/cwy.png'), ":ermm:" => URL::to_asset('bundles/forums/emoticons/ermm.png'), ":D" => URL::to_asset('bundles/forums/emoticons/grin.png'), "=D" => URL::to_asset('bundles/forums/emoticons/grin.png'), "<3" => URL::to_asset('bundles/forums/emoticons/heart.png'), ":(" => URL::to_asset('bundles/forums/emoticons/sad.png'), ":O" => URL::to_asset('bundles/forums/emoticons/shocked.png'), ":P" => URL::to_asset('bundles/forums/emoticons/tongue.png'), "=(" => URL::to_asset('bundles/forums/emoticons/sad.png'), "=[" => URL::to_asset('bundles/forums/emoticons/sad.png'), "=O" => URL::to_asset('bundles/forums/emoticons/shocked.png'), "=P" => URL::to_asset('bundles/forums/emoticons/tongue.png'), ";)" => URL::to_asset('bundles/forums/emoticons/wink.png'), ":alien:" => URL::to_asset('bundles/forums/emoticons/alien.png'), ":blink:" => URL::to_asset('bundles/forums/emoticons/blink.png'), ":blush:" => URL::to_asset('bundles/forums/emoticons/blush.png'), ":cheerful:" => URL::to_asset('bundles/forums/emoticons/cheerful.png'), ":devil:" => URL::to_asset('bundles/forums/emoticons/devil.png'), ":dizzy:" => URL::to_asset('bundles/forums/emoticons/dizzy.png'), ":getlost:" => URL::to_asset('bundles/forums/emoticons/getlost.png'), ":happy:" => URL::to_asset('bundles/forums/emoticons/happy.png'), ":kissing:" => URL::to_asset('bundles/forums/emoticons/kissing.png'), ":ninja:" => URL::to_asset('bundles/forums/emoticons/ninja.png'), ":pinch:" => URL::to_asset('bundles/forums/emoticons/pinch.png'), ":pouty:" => URL::to_asset('bundles/forums/emoticons/pouty.png'), ":sick:" => URL::to_asset('bundles/forums/emoticons/sick.png'), ":sideways:" => URL::to_asset('bundles/forums/emoticons/sideways.png'), ":silly:" => URL::to_asset('bundles/forums/emoticons/silly.png'), ":sleeping:" => URL::to_asset('bundles/forums/emoticons/sleeping.png'), ":unsure:" => URL::to_asset('bundles/forums/emoticons/unsure.png'), ":woot:" => URL::to_asset('bundles/forums/emoticons/w00t.png'), ":wassat:" => URL::to_asset('bundles/forums/emoticons/wassat.png')));
    return $instance;
});
class BBCodeParser
{
    public static function parse($elements)
    {
        $parser = IoC::resolve('BBCodeDocParser');
        return $parser->parse($elements)->detect_links()->detect_emails()->detect_emoticons()->get_html();
    }
}
Ejemplo n.º 11
0
<!doctype html>
<html>
<head>
	<title>Flickr Search Results</title>
	<link rel="stylesheet" href="<?php 
echo URL::to_asset('css/default.css');
?>
">
</head>
<body>

	<p>You searched for: <?php 
echo $search_term;
?>
</p>

	<div id="results">
		<?php 
foreach ($results as $photo) {
    $id = $photo['id'];
    $farm = $photo['farm'];
    $secret = $photo['secret'];
    $server_id = $photo['server'];
    $img_src = "http://farm" . $farm . ".staticflickr.com/" . $server_id . "/" . $id . "_" . $secret . "_m.jpg";
    echo '<img src="' . $img_src . '" />';
}
?>
	</div>

</body>
</html>
Ejemplo n.º 12
0
    <div class="image-stat"><i class="icon-eye-open"></i> <?php 
    echo $gallery->views;
    ?>
</div>
    <b><?php 
    echo $gallery->name;
    ?>
</b>
  </div>
  <div class="image-holder">
    <a href="<?php 
    echo URL::to('home/gallery/' . $gallery->id);
    ?>
">
      <img src="<?php 
    echo URL::to_asset('images/' . $gallery->id . '/' . $gallery->thumb);
    ?>
">
    </a>
  </div>
  </div>
</div>
<?php 
    if ($i % 4 == 0) {
        echo '</div><div class="row">';
    }
    $i++;
}
?>

</div>
Ejemplo n.º 13
0
		<link rel="shortcut icon" href="<?php 
echo URL::to_asset('img/favicon.png');
?>
">

		<!-- styles -->
		<link href="<?php 
echo URL::to_asset('css/style.css');
?>
?3" rel="stylesheet" type="text/css">

		<!-- Js for fonts and tracking -->
		<script type="text/javascript" src="http://use.typekit.com/dlj4kfm.js"></script>
		<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
		<script type="text/javascript" src="<?php 
echo URL::to_asset('js/modernizr-2.5.2.min.js');
?>
"></script>

		<script type="text/javascript">
			var _gaq = _gaq || [];
			_gaq.push(['_setAccount', 'UA-23865777-1']);
			_gaq.push(['_trackPageview']);

			(function() {
				var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
			    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
			    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
			})();
		</script>
	</head>
Ejemplo n.º 14
0
		<meta name="viewport" content="width=device-width,initial-scale=1">

		<title><?php 
echo Config::get('application.my_bugs_app.name');
?>
</title>
		<?php 
echo Asset::styles();
?>
	</head>
<body>
	<div id="container">
		<div id="login">
			
			<h1>Welcome to<br><img src="<?php 
echo URL::to_asset('app/assets/images/layout/tinyissue.svg');
?>
" alt="<?php 
echo Config::get('application.my_bugs_app.name');
?>
" style="width:350px;;"></h1>
			<form method="post">


				<table class="form" >
					<tr>
						<td colspan="2" style="color: #a31500;"><?php 
echo Session::get('error');
?>
</td>
					</tr>
Ejemplo n.º 15
0
?>
">Download <i class="download"></i></a></li>
					</ul>
					<ul class="social span3 offset2">
						<li><a href="http://github.com/laravel"><i class="github"></i> GitHub</a></li>
						<li><a href="http://twitter.com/laravelphp"><i class="twitter"></i> Twitter</a></li>
					</ul>
				</div>
			</div>
		</footer>

		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
		<script>window.jQuery || document.write('<script src="<?php 
echo URL::to_asset('js/jquery-1.7.1.min.js');
?>
"><\/script>')</script>
		<script src="<?php 
echo URL::to_asset('js/bootstrap.min.js');
?>
"></script>
		<script src="<?php 
echo URL::to_asset('js/main-min.js');
?>
"></script>
		<script src="<?php 
echo URL::to_asset('js/google-code-prettify/prettify.js');
?>
"></script>
		<script>$(function(){prettyPrint()})</script>
	</body>
</html>
Ejemplo n.º 16
0
                    </div>
                    <div class="control-group">
                        <div class="control-label">
                            <label for="password">Clave</label>
                        </div>
                        <div class="controls">
                            <input type="password" class="input-large" name="password" id="password" value="">
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="controls">
                            <label class="checkbox" for="remember">
                                <input type="checkbox" id="remember" name="remember" value="1"> Recuerdame
                            </label>
                            <button type="submit" class="btn btn-primary">Acceder</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="<?php 
echo URL::to_asset('js/jquery-1.8.3.min.js');
?>
"></script>
    <script type="text/javascript" src="<?php 
echo URL::to_asset('js/bootstrap.min.js');
?>
"></script>
</body>
</html>
Ejemplo n.º 17
0
echo $errors->first('email', '<span class="error">:message</span>');
?>
				</td>
			</tr>

            <tr>
                <th><?php 
echo __('tinyissue.avatar');
?>
</th>
                <td>
                    <img height="30px" src="<?php 
if ($user->avatar != '') {
    echo URL::to_asset($user->avatar);
} else {
    echo URL::to_asset('uploads/avatar/avatarDefault.png');
}
?>
" />
                    <br/>
                    <br/>
                    <input type="file"  value="<?php 
echo Input::old('avatar');
?>
"  name="avatar"  />
                </td>
            </tr>

			<tr>
				<th><?php 
echo __('tinyissue.language');
Ejemplo n.º 18
0
 /**
  * Generate an HTML image element.
  *
  * @param  string  $url
  * @param  string  $alt
  * @param  array   $attributes
  * @return string
  */
 public static function image($url, $alt = '', $attributes = array())
 {
     $attributes['alt'] = $alt;
     return '<img src="' . URL::to_asset($url) . '"' . static::attributes($attributes) . '>';
 }
Ejemplo n.º 19
0
<?php

return array('kcfinder' => array('paths' => array('filebrowserBrowseUrl' => URL::to_asset('/bundles/ckeditor/kcfinder/browse.php?type=files'), 'filebrowserImageBrowseUrl' => URL::to_asset('/bundles/ckeditor/kcfinder/browse.php?type=images'), 'filebrowserFlashBrowseUrl' => URL::to_asset('/bundles/ckeditor/kcfinder/browse.php?type=flash'), 'filebrowserUploadUrl' => URL::to_asset('/bundles/ckeditor/kcfinder/upload.php?type=files'), 'filebrowserImageUploadUrl' => URL::to_asset('/bundles/ckeditor/kcfinder/upload.php?type=images'), 'filebrowserFlashUploadUrl' => URL::to_asset('/bundles/ckeditor/kcfinder/upload.php?type=flash'))));
Ejemplo n.º 20
0
}
?>

        @yield('content')

        @yield('headerBtn')
    </div>
</body>

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="<?php 
echo URL::to_asset('js/libs/swipe.js');
?>
"></script>
<script type="text/javascript" src="<?php 
echo URL::to_asset('js/libs/jquery.hammer.js');
?>
"></script>
<script type="text/javascript" src="<?php 
echo URL::to_asset('js/libs/jquery.touchclick.js');
?>
"></script>
<script type="text/javascript" src="<?php 
echo URL::to_asset('js/app/alerts.js');
?>
"></script>
<script type="text/javascript" src="<?php 
echo URL::to_asset('js/app/bracket.js?2');
?>
"></script>
</html>
Ejemplo n.º 21
0
 /** print lembar disposisi */
 public function get_disposisi($id)
 {
     // re-use model view_surat
     $view_surat = Suratmasuk::view_surat($id);
     if ($view_surat) {
         // generate pdf, return string file name, simpan di variabel
         $generate_pdf = Printpdf::generate_lembar_disposisi($view_surat);
         // open generated pdf file
         $path_to_pdf = 'pdf/' . $generate_pdf;
         $url_to_pdf = URL::to_asset($path_to_pdf);
         return Redirect::to($url_to_pdf);
     } else {
         // return error 404 apabila mengakses ID surat yg tidak ada di database
         return View::make('error.404');
     }
 }
Ejemplo n.º 22
0
" sizes="160x160">
		<link rel="icon" type="image/png" href="<?php 
echo URL::to_asset('/favicon-96x96.png');
?>
" sizes="96x96">
		<link rel="icon" type="image/png" href="<?php 
echo URL::to_asset('/favicon-16x16.png');
?>
" sizes="16x16">
		<link rel="icon" type="image/png" href="<?php 
echo URL::to_asset('/favicon-32x32.png');
?>
" sizes="32x32">
		<meta name="msapplication-TileColor" content="#39404f">
		<meta name="msapplication-TileImage" content="<?php 
echo URL::to_asset('/mstile-144x144.png');
?>
">
		<meta name="application-name" content="<?php 
Config::get('my_bugs_app.name');
?>
">	
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1">
		<title><?php 
echo Config::get('application.my_bugs_app.name');
?>
</title>
		<script>
			var siteurl = '<?php 
echo URL::to();
Ejemplo n.º 23
0
?>
" width="32" alt="Laravel"></a>
        </p>
    </div>
   </footer>
    <script type="text/javascript" src="<?php 
echo URL::to_asset('js/jquery-1.8.3.min.js');
?>
"></script>
    <script type="text/javascript" src="<?php 
echo URL::to_asset('js/bootstrap.min.js');
?>
"></script>
    <script type="text/javascript" src="<?php 
echo URL::to_asset('js/bootbox.min.js');
?>
"></script>
    <script type="text/javascript" src="<?php 
echo URL::to_asset('js/bootstrap.overrides.min.js');
?>
"></script>
    <script type="text/javascript" src="<?php 
echo URL::to_asset('js/bootstrap.tagit.min.js');
?>
"></script>
    <script type="text/javascript" src="<?php 
echo URL::to_asset('js/backend.min.js');
?>
"></script>
</body>
</html>
Ejemplo n.º 24
0
 /**
  * Test language based URL generation.
  *
  * @group laravel
  */
 public function testUrlsGeneratedWithLanguages()
 {
     Config::set('application.languages', array('sp', 'fr'));
     Config::set('application.language', 'sp');
     $this->assertEquals('http://localhost/index.php/sp/foo', URL::to('foo'));
     $this->assertEquals('http://localhost/foo.jpg', URL::to_asset('foo.jpg'));
     Config::set('application.index', '');
     $this->assertEquals('http://localhost/sp/foo', URL::to('foo'));
     Config::set('application.index', 'index.php');
     Config::set('application.language', 'en');
     $this->assertEquals('http://localhost/index.php/foo', URL::to('foo'));
     Config::set('application.languages', array());
 }
Ejemplo n.º 25
0
 /**
  * Generate lembar disposisi menggunakan FPDF.
  */
 public static function generate_lembar_disposisi($input)
 {
     $pdf = new Fpdf();
     /**
      * TODO:
      * Ubah posisi y dari perhitungan manual menjadi menggunakan GetY SetY
      */
     $pdf->SetLineWidth(0.01);
     // 0.01mm
     // specify margin variables, dalam unit milimeter
     $margin_left = 5;
     $margin_top = 10;
     $margin_right = 10;
     $pdf->SetMargins($margin_left, $margin_top, $margin_right);
     $pdf->AddPage();
     $pdf->Image(URL::to_asset('img/logo.png'), $margin_left, $margin_top, 0, 25);
     // specify height variables
     $h1 = 6;
     $h2 = 1.5 * $h1;
     $h3 = 2 * $h1;
     /**
      * Bagian Header
      */
     $span1 = 30;
     $span2 = 40;
     $span3 = 50;
     $span4 = 60;
     /* line 1 */
     $pdf->SetFont('Times', 'B', 16);
     $pdf->Cell($span1, $h1, '');
     $pdf->Cell(160, $h1, 'Direktorat Jenderal Pajak', 0, 0, 'C');
     $pdf->Ln();
     /* line 2 */
     $pdf->SetFont('Times', 'B', 12);
     $pdf->Cell($span1, $h1, '');
     $pdf->Cell(160, $h1, strtoupper($input->nama_kpp), 0, 0, 'C');
     $pdf->Ln();
     /* line 3 */
     $pdf->Cell($span1, $h1, '');
     $pdf->Cell(160, $h1, $input->nama_seksi, 0, 0, 'C');
     $line_x1 = $margin_left + $span1;
     $line_y1 = $margin_top + 3 * $h1;
     $line_x2 = 210 - $margin_right;
     $line_y2 = $line_y1;
     $pdf->Line($line_x1, $line_y1, $line_x2, $line_y2);
     $pdf->Ln();
     /* line 4 */
     $pdf->SetFont('Times', '', 14);
     $pdf->Cell($span1, $h3, '');
     $pdf->Cell(160, $h3, 'LEMBAR DISPOSISI', 0, 0, 'C');
     $line_x1 = $margin_left + $span1 + 10;
     $line_y1 = $margin_top + 3 * $h1 + $h2;
     $line_x2 = 210 - $margin_right - 10;
     $line_y2 = $line_y1;
     $pdf->Line($line_x1, $line_y1, $line_x2, $line_y2);
     $pdf->Ln();
     /* line 5, blank line */
     $pdf->Cell(210 - $margin_left - $margin_right, $h3, '');
     $pdf->Ln();
     /**
      * variable font size
      */
     $font_size = 10;
     /* line 6 */
     // output label left
     $pdf->SetFont('Times', '', $font_size);
     $pdf->Cell($span1, $h2, 'Tanggal Diterima:');
     $pdf->SetFont('Arial', '', $font_size);
     $pdf->Cell($span4 + 10, $h2, Printpdf::full_tanggal($input->tgl_diterima));
     // divider
     $pdf->Cell(10, $h2, '');
     //output label right
     $pdf->SetFont('Times', '', $font_size);
     $pdf->Cell($span1, $h2, 'Nomor Agenda:');
     $pdf->SetFont('Arial', '', $font_size);
     // cek apakah nomor Agenda otomatis akan ikut dicetak?
     $tampilkan_nomor_agenda = Konfigurasi::find(8)->config_value;
     if ($tampilkan_nomor_agenda == 1) {
         $pdf->Cell($span4 + 5 - $margin_right, $h2, $input->nomor_agenda_seksi);
     } else {
         $pdf->Cell($span4 + 5 - $margin_right, $h2, '');
     }
     // border-bottom dibuat secara manual agar posisinya bisa diatur dan tidak
     // dipengaruhi cell height
     // underline content left
     $line_x1 = $margin_left + $span1;
     $line_y1 = $margin_top + 4 * $h1 + 2 * $h3 + 1;
     $line_x2 = $line_x1 + $span4 + 10;
     $line_y2 = $line_y1;
     $pdf->Line($line_x1, $line_y1, $line_x2, $line_y2);
     // underline content right
     $line_x1 = 210 - $margin_right - ($span4 + 5 - $margin_right);
     $line_y1 = $line_y1;
     $line_x2 = 210 - $margin_right;
     $line_y2 = $line_y1;
     $pdf->Line($line_x1, $line_y1, $line_x2, $line_y2);
     $pdf->Ln();
     /* line 7 */
     // output label left
     $pdf->SetFont('Times', '', $font_size);
     $pdf->Cell($span1, $h2, 'Nomor Surat:');
     $pdf->SetFont('Arial', '', $font_size);
     $pdf->Cell($span4 + 10, $h2, $input->nomor_surat);
     // divider
     $pdf->Cell(10, $h2, '');
     //output label right
     $pdf->SetFont('Times', '', $font_size);
     $pdf->Cell($span1, $h2, 'No. Agenda Sekre:');
     $pdf->SetFont('Arial', '', $font_size);
     $pdf->Cell($span4 + 5 - $margin_right, $h2, $input->nomor_agenda_sekre);
     // underline content left
     $line_x1 = $margin_left + $span1;
     $line_y1 = $line_y1 + $h2;
     $line_x2 = $line_x1 + $span4 + 10;
     $line_y2 = $line_y1;
     $pdf->Line($line_x1, $line_y1, $line_x2, $line_y2);
     // underline content right
     $line_x1 = 210 - $margin_right - ($span4 + 5 - $margin_right);
     $line_y1 = $line_y1;
     $line_x2 = 210 - $margin_right;
     $line_y2 = $line_y1;
     $pdf->Line($line_x1, $line_y1, $line_x2, $line_y2);
     $pdf->Ln();
     /* line 8 */
     // output label left
     $pdf->SetFont('Times', '', $font_size);
     $pdf->Cell($span1, $h2, 'Tanggal Surat:');
     $pdf->SetFont('Arial', '', $font_size);
     $pdf->Cell($span4 + 10, $h2, Printpdf::full_tanggal($input->tgl_surat));
     // underline content left
     $line_x1 = $margin_left + $span1;
     $line_y1 = $line_y1 + $h2;
     $line_x2 = $line_x1 + $span4 + 10;
     $line_y2 = $line_y1;
     $pdf->Line($line_x1, $line_y1, $line_x2, $line_y2);
     $pdf->Ln();
     /* line 9 */
     // output label left
     $pdf->SetFont('Times', '', $font_size);
     $pdf->Cell($span1, $h2, 'Nama Pengirim:');
     $pdf->SetFont('Arial', '', $font_size);
     $pdf->Cell(210 - $margin_right - $margin_left - $span1, $h2, strtoupper($input->pengirim));
     // underline content left
     $line_x1 = $margin_left + $span1;
     $line_y1 = $line_y1 + $h2;
     $line_x2 = 210 - $margin_right;
     $line_y2 = $line_y1;
     $pdf->Line($line_x1, $line_y1, $line_x2, $line_y2);
     $pdf->Ln();
     /* line 10 */
     // output label left
     $pdf->SetFont('Times', '', $font_size);
     $pdf->Cell($span1, $h2, 'Perihal:');
     $pdf->SetFont('Arial', '', $font_size);
     $pdf->drawTextBox(strtoupper($input->hal), 210 - $margin_right - $margin_left - $span1, $h3 + $h1 / 2, 'L', 'T', 0, $h1 / 2);
     // underline content left
     $line_x1 = $margin_left + $span1;
     $line_y1 = $line_y1 + $h3 + $h1 / 2 + 1;
     $line_x2 = 210 - $margin_right;
     $line_y2 = $line_y1;
     $pdf->Line($line_x1, $line_y1, $line_x2, $line_y2);
     $pdf->Ln();
     /* line 11 */
     $pdf->SetFont('Times', '', $font_size);
     $y = $line_y1 + $h3;
     $pdf->SetY($y);
     $pdf->SetStyle("em", "Times", "I", 0, "0,0,0");
     $pdf->SetStyle("p", "Times", "N", $font_size, "0,0,0", 0);
     $pdf->SetStyle("content", "Arial", "", 0, "0,0,0");
     $pdf->SetStyle("strong", "Times", "B", 0, "0,0,0");
     $pdf->WriteTag(210 - $margin_left - $margin_right, $h1, '<p>PERHATIAN: <em>Dilarang memisahkan sehelai surat pun dari berkas yang telah disusun.</em></p>', 0, 'C');
     /**
      * line 12
      * print daftar disposisi, daftar sifat, daftar petunjuk
      */
     // set to correct y position
     $pdf->SetY($y + $h1);
     // create 3 column
     $spacer = 1;
     $box_width = (210 - $margin_left - $margin_right - 2) / 2;
     // box_width akan dipakai untuk dua kolom
     $checkbox_width = 8;
     $box_text_width = $box_width - $checkbox_width;
     // save y position
     $save_y_position = $pdf->GetY();
     // print right box first
     $pdf->Cell($box_width + $spacer, $h1, '');
     // padding-left hack :)
     $pdf->SetFont('Times', 'B', $font_size);
     $pdf->Cell($box_width, $h1, 'Ditujukan kepada:', 'LTR');
     $pdf->Ln();
     /* iterasi */
     foreach ($input->daftar_disposisi as $row) {
         if ($row->aktif) {
             // padding-left hack :)
             $pdf->Cell($box_width + $spacer, $h1, '');
             // draw checkbox
             Printpdf::draw_checkbox($pdf, in_array($row->id, $input->disposisi), $font_size, $h1, $checkbox_width);
             // print daftar nama
             $pdf->SetFont('Times', '', $font_size);
             $pdf->Cell($box_text_width, $h1, $row->nama, 'R');
             $pdf->Ln();
         }
     }
     // print daftar disposisi lain-lain
     if (!empty($input->lain_lain)) {
         // padding-left
         $pdf->Cell($box_width + $spacer, $h1, '');
         // draw checkbox
         Printpdf::draw_checkbox($pdf, true, $font_size, $h1, $checkbox_width);
         // print lain-lain
         $pdf->SetFont('Times', '', $font_size);
         $pdf->Cell($box_text_width, $h1, $input->lain_lain, 'R');
         $pdf->Ln();
     }
     // bottom space and border
     $pdf->Cell($box_width + $spacer, $h1, '');
     $pdf->Cell($box_width, $h1 / 2, '', 'RLB');
     $pdf->Ln();
     // save y position untuk reset posisi box catatan
     $catatan_box_y_position_1 = $pdf->GetY();
     // reset y position, print left box
     $pdf->SetY($save_y_position);
     $pdf->SetFont('Times', 'B', $font_size);
     $pdf->Cell($box_width, $h1, 'Sifat:', 'LTR');
     $pdf->Ln();
     /* iterasi */
     $pdf->SetFont('Times', '', $font_size);
     foreach ($input->daftar_sifat as $key => $value) {
         // draw checkbox
         Printpdf::draw_checkbox($pdf, in_array($key, $input->sifat), $font_size, $h1, $checkbox_width);
         // print daftar sifat
         $pdf->SetFont('Times', '', $font_size);
         $pdf->Cell($box_text_width, $h1, $value, 'R');
         $pdf->Cell($spacer, $h1, '', '');
         $pdf->Ln();
     }
     // continue print left box
     $pdf->SetFont('Times', 'B', $font_size);
     $pdf->Cell($box_width, $h1, 'Petunjuk:', 'LR');
     $pdf->Ln();
     /* iterasi */
     $pdf->SetFont('Times', '', $font_size);
     foreach ($input->daftar_petunjuk as $row) {
         // draw checkbox
         Printpdf::draw_checkbox($pdf, in_array($row->id, $input->petunjuk), $font_size, $h1, $checkbox_width);
         // print daftar petunjuk
         $pdf->SetFont('Times', '', $font_size);
         $pdf->Cell($box_text_width, $h1, $row->petunjuk, 'R');
         $pdf->Cell($spacer, $h1, '', '');
         $pdf->Ln();
     }
     // copy
     $dots = '........';
     if ($input->copy > 0) {
         $copy = '  ' . $input->copy . '  ';
         Printpdf::draw_checkbox($pdf, true, $font_size, $h1, $checkbox_width);
     } else {
         $copy = $dots;
         Printpdf::draw_checkbox($pdf, false, $font_size, $h1, $checkbox_width);
     }
     $pdf->SetFont('Times', '', $font_size);
     $pdf->Cell($box_text_width, $h1, 'Perbanyak: ' . $copy . ' kali,  Asli ke: ' . $dots, 'R');
     $pdf->Ln();
     // bottom border
     $pdf->Cell($box_width, $h1 / 2, '', 'RLB');
     $pdf->Ln();
     // save y position untuk reset posisi box catatan
     $catatan_box_y_position_2 = $pdf->GetY();
     /* line 13 */
     // adjust y position
     $y = $catatan_box_y_position_1 > $catatan_box_y_position_2 ? $catatan_box_y_position_1 : $catatan_box_y_position_2;
     $pdf->SetY($y + 1);
     // print box catatan
     $pdf->SetFont('Times', 'U', $font_size);
     $pdf->Cell(0, $h1, 'CATATAN:', 'LTR');
     $pdf->Ln();
     // save y position
     $y = $pdf->GetY();
     // print text catatan
     $pdf->SetFont('Arial', '', $font_size - 1);
     $pdf->drawTextBox(strtoupper($input->catatan), 210 - $margin_right - $margin_left, 'L', 'T', 1, $h1 / 2);
     // reset position, draw fake border
     $pdf->SetY($y);
     $pdf->Cell(0, $h3, '', 'LBR');
     $pdf->Ln();
     /* line 14 */
     // adjust y position
     $y = $pdf->GetY();
     $pdf->SetY($y + 2);
     // print field tambahan
     $pdf->SetFont('Times', '', $font_size);
     $pdf->Cell(0, 5, 'PENGELOLAAN PADA SEKSI TERKAIT:');
     $pdf->Ln();
     /* line 15 */
     // dua kolom hal yang sama
     $half_width = (210 - $margin_left - $margin_right) / 2;
     $hw = $half_width;
     $padding_right = 20;
     $pdf->SetFont('Times', 'B', $font_size);
     $pdf->Cell($half_width, 7, 'Diteruskan ke:');
     $pdf->Cell($half_width, 7, 'Diteruskan ke:');
     $pdf->Ln();
     $s1 = '1. Seksi: ';
     $s2 = '2. Diterima Seksi: ';
     $s3 = '3. Selesai diproses: ';
     $dot1 = str_repeat('.', 71);
     $dot2 = str_repeat('.', 56);
     $dot3 = str_repeat('.', 54);
     $w1 = $pdf->GetStringWidth($s1);
     $w2 = $pdf->GetStringWidth($s2);
     $w3 = $pdf->GetStringWidth($s3);
     $pdf->SetFont('Times', '', $font_size);
     // print text dengan dotted yang right-aligned
     $pdf->Cell($hw - ($hw - $w1) - $padding_right, 4, $s1);
     $pdf->Cell($hw - $w1, 4, $dot1, 0, '', 'R');
     $pdf->Cell($padding_right, 4, '');
     $pdf->Cell($hw - ($hw - $w1) - $padding_right, 4, $s1);
     $pdf->Cell($hw - $w1, 4, $dot1, 0, '', 'R');
     $pdf->Cell($padding_right, 4, '');
     $pdf->Ln();
     $pdf->Cell($hw - ($hw - $w2) - $padding_right, 4, $s2);
     $pdf->Cell($hw - $w2, 4, $dot2, 0, '', 'R');
     $pdf->Cell($padding_right, 4, '');
     $pdf->Cell($hw - ($hw - $w2) - $padding_right, 4, $s2);
     $pdf->Cell($hw - $w2, 4, $dot2, 0, '', 'R');
     $pdf->Cell($padding_right, 4, '');
     $pdf->Ln();
     $pdf->Cell($hw - ($hw - $w3) - $padding_right, 4, $s3);
     $pdf->Cell($hw - $w3, 4, $dot3, 0, '', 'R');
     $pdf->Cell($padding_right, 4, '');
     $pdf->Cell($hw - ($hw - $w3) - $padding_right, 4, $s3);
     $pdf->Cell($hw - $w3, 4, $dot3, 0, '', 'R');
     $pdf->Cell($padding_right, 4, '');
     $pdf->Ln();
     // generate pdf ke folder 'public' subfolder 'pdf'
     $file_name = 'print' . time() . '.pdf';
     $output_path = Printpdf::pdf_folder_path() . $file_name;
     $pdf->Output($output_path, 'F');
     return $file_name;
 }