Exemple #1
0
 private function _uploadImage($field_name)
 {
     $upload = $this->getLibrary('upload');
     $folder = server_upload_path();
     $upload_path = server_upload_abs_path($folder);
     //添加文件夹
     if (!file_exists($upload_path)) {
         mkdir($upload_path, DIR_WRITE_MODE, true);
     }
     //$allowed_types = '*';
     //$config['max_size'] = '2048';
     $file_name = time() . rand(1000, 9999);
     // 		$this->upload->initialize($config);
     $upload = $upload->upload($field_name, $file_name, $upload_path, array('allowFileType' => '*'));
     if (is_int($upload)) {
         $this->controller->json_return(array('msg' => '', 'state' => 'FAILURE', 'imageid' => 0));
     }
     $abs_path = file_abs_path($folder, $upload['newName']);
     $hash = md5(file_get_contents($abs_path));
     $relative_path = $folder . $upload['newName'];
     $sizeAry = getimagesize($abs_path);
     list($width, $height, $type) = $sizeAry;
     $imageModel = InitPHP::getMysqlDao('image');
     //判断图片是否存在
     $exists = $imageModel->checkHash($hash);
     if (!empty($exists)) {
         //如果存在
         $this->controller->json_return(array('url' => upload_url($exists['path']), 'state' => 'SUCCESS', 'imageid' => $exists['id']));
     }
     $image = array('path' => $relative_path, 'size' => $upload['size'], 'width' => $width, 'height' => $height, 'type' => $type, 'hash' => $hash, 'create_time' => time());
     $image_id = $imageModel->insert($image);
     $this->controller->json_return(array('url' => upload_url($relative_path), 'state' => 'SUCCESS', 'imageid' => $image_id));
 }
Exemple #2
0
function upload_img($uri, $size = 'thumb', $tag = true)
{
    switch ($size) {
        case 'full':
            $type = 'full';
            break;
        case 'medium':
            $type = 'medium';
            break;
        case 'small':
            $type = 'small';
            break;
        default:
            $type = 'thumbnails';
            break;
    }
    $path_img = upload_url($type . '/' . $uri);
    return _img($path_img, $uri, $tag);
}
Exemple #3
0
    $data['message'] = $this->session->flashdata('failed');
    $this->load->view('admin/notification_failed', $data);
}
?>

                        <div class="nav_menu">
                            <nav class="" role="navigation">
                                <div class="nav toggle">
                                    <a id="menu_toggle"><i class="fa fa-bars"></i></a>
                                </div>
                                <ul class="nav navbar-nav navbar-right">
                                    <li class="">
                                        <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                                            
                                            <img src="<?php 
echo upload_url() . '/users/' . $this->session->userdata('user_image');
?>
"class="img-responsive ava-detail">
                                            
                                            <?php 
echo $text = ucfirst($this->session->userdata('user_full_name'));
?>
                                            <span class=" fa fa-angle-down"></span> 
                                        </a>
                                        <ul class="dropdown-menu dropdown-usermenu animated fadeInDown pull-right">
                                            <li><a href="<?php 
echo site_url('admin/dashboard');
?>
">  Home</a>
                                            </li>
                                            <li><a href="<?php 
Exemple #4
0
                <input type="text" name="member_score" placeholder="Akhir Penilaian" class="form-control" value="<?php 
echo $inputScore;
?>
"><br>

                <p style="color:#9C9C9C;margin-top: 5px"><i>*) Wajib diisi</i></p>
            </div>
            <div class="col-sm-12 col-xs-12 col-md-3">
                <div class="form-group">
                    <label >Upload Photo </label>
                    <input type="file" name="member_image" class="form-control" ><br>
                    <?php 
if (isset($member) and $member['member_image'] != NULL) {
    ?>
                    <img src="<?php 
    echo upload_url('member_photo/' . pretty_date($member['member_input_date'], 'Y/m/d/', FALSE) . $member['member_image']);
    ?>
" class="img-responsive ava-detail"><br>
                    <?php 
}
?>
    
                    <label>Status *</label>
                    <div class="radio">
                        <label>
                            <input type="radio" name="member_status" value="0" <?php 
echo $inputStatus == '0' ? 'checked' : '';
?>
> Non-Aktif
                        </label>
                    </div>
Exemple #5
0
        ?>

                                        <?php 
        if ($image['info'] != '0') {
            ?>
                                            <div class="img-info">
                                                <p><a class="info-news" href=""><?php 
            echo $label;
            ?>
</a></p>
                                                <div class="imgaction">
                                                    <?php 
            if ($type == 'image') {
                ?>
                                                        <a href="" class="zoomin"><i class="glyphicon glyphicon-zoom-in icon-white" title="zoom in"></i><input type="hidden" value="<?php 
                echo upload_url($image['name']) . '?' . uniqid();
                ?>
" /></a>
                                                    <?php 
            } else {
                ?>
                                                        <a href="javascript:window.open('<?php 
                echo site_url('/admin/media_manager/viewapp/' . $image['id']);
                ?>
','<?php 
                echo $image['label'];
                ?>
','width=600,height=550');"><i class="glyphicon glyphicon-zoom-in icon-white" title="zoom in"></i></a>
                                                    <?php 
            }
            ?>
Exemple #6
0
?>
" class="btn btn-info"><span class="fa fa-arrow-left"></span>&nbsp; Kembali</a> 
                    <a href="<?php 
echo site_url('admin/posts/edit/' . $posts['posts_id']);
?>
" class="btn btn-success"><span class="fa fa-edit"></span>&nbsp; Edit</a> 
                </span>
            </div>
        </div><br>
        <div class="row">
            <div class="col-md-2">
                <?php 
if (!empty($posts['posts_image'])) {
    ?>
                    <img src="<?php 
    echo upload_url($posts['posts_image']);
    ?>
" class="img-responsive ava-detail">
                <?php 
} else {
    ?>
                    <img src="<?php 
    echo base_url('media/image/missing-image.png');
    ?>
" class="img-responsive ava-detail">
                <?php 
}
?>
            </div>
            <div class="col-md-10">
                <table class="table table-striped">
Exemple #7
0
 public function viewapp($id)
 {
     $image = $this->Mediamanager_model->get($id);
     $filename = $image['name'];
     $file = upload_url($filename);
     //header('Content-type: application/pdf');
     header('Content-type: ' . $image['type']);
     header('Content-Disposition: inline; filename="' . $filename . '"');
     header('Content-Transfer-Encoding: binary');
     header('Accept-Ranges: bytes');
     @readfile($file);
 }
Exemple #8
0
</div> 
    </span>
    <img style="position:absolute;left:29pt;top:85pt;width:242pt;height:13pt;z-index:21;" src="<?php 
echo media_url();
?>
/images/bpjs/5abe171dd5c85a6623370fa88cacef78.png" alt="Image_11_0" />
    <img style="position:absolute;left:23.5pt;top:31.5pt;width:248pt;height:24pt;z-index:44;" src="<?php 
echo media_url();
?>
/images/bpjs/b1e4f2e11ff22a852ee9b6c78f2b225d.png" alt="__rendered_path__44" /></span> 

  <span class="fmt-1" style="white-space:pre;"></span><span class="fmt-1" style="white-space:pre;"></span><span class="fmt-2" style="position:absolute;left:0pt;top:0pt;width:100%;height:100%;clip:rect(0pt,612pt,325pt,0pt);"><img style="position:absolute;left:32pt;top:188pt;width:193pt;height:18pt;z-index:5;" src="<?php 
echo media_url();
?>
/images/bpjs/c92d59550dcf3e955ddda34b0fcaf66c.png" alt="__rendered_path__5" /></span><img style="position:absolute;left:40pt;top:188pt;width:142.56pt;height:18pt;z-index:6;" src="<?php 
echo upload_url() . '/bpjs/' . $bpjs['bpjs_noka'] . '.png';
?>
" alt="Image_4_0" />

  <span style="white-space:pre;">
    <div style="position:absolute;top:206.3pt;left:83.48pt;z-index:4;"><?php 
echo pretty_date(date('Y-m-d'), 'd m Y', FALSE);
?>
</div>
  </span>
  <img style="position:absolute;left:320pt;top:30pt;width:245pt;height:3pt;z-index:42;" src="<?php 
echo media_url();
?>
/images/bpjs/cdd3dd736f8fb7872cc94a72e85e6b5a.png" alt="__rendered_path__42" />
  <span class="fmt-3" style="white-space:pre;">
    <div style="position:absolute;top:40.06pt;left:323pt;z-index:17;">Syarat-syarat Ketentuan Umum :</div></span>
Exemple #9
0
echo site_url('admin/user');
?>
" class="btn btn-info btn-sm"><span class="fa fa-arrow-left"></span>&nbsp; Kembali</a> 
                    <a href="<?php 
echo site_url('admin/user/edit/' . $user['user_id']);
?>
" class="btn btn-success btn-sm"><span class="fa fa-edit"></span>&nbsp; Edit</a> 
                </span>
            </h3><br>
        </div>
            <div class="col-md-2">
            <?php 
if (!empty($user['user_image'])) {
    ?>
            <img src="<?php 
    echo upload_url('users/' . $user['user_image']);
    ?>
" class="img-responsive ava-detail">
            <?php 
} else {
    ?>
                <img src="<?php 
    echo base_url('media/images/user.png');
    ?>
" class="img-responsive ava-detail">
            <?php 
}
?>
        </div>
        <div class="col-md-10">
            <table class="table table-striped">
Exemple #10
0
			

			<div class="row">
				<div class="col-md-9 col-md-offset-3">
					<div class="row">
						<div class="col-md-6">
							<a href="#" class="btn btn-primary btn-lg btn-block">ข่าวสารประชาสัมพันธ์</a>
						</div>
						<div class="col-md-6">
							<a href="#" class="btn btn-primary btn-lg btn-block">กิจกรรมภายในองค์กร</a>
						</div>
					</div>
					<div class="row">
						<div class="col-md-4">
							<img src="<?php 
echo upload_url();
?>
only_programmers_understand_only.png" class="img-responsive" />
						</div>
						<div class="col-md-8">
							<p>นายโปรแกรมเมอร์ PHP หน่วยงาน : โปรแกรมเมอร์หน่วยงาน : โปรแกรมเมอร์หน่วยงาน : โปรแกรมเมอร์หน่วยงาน : โปรแกรมเมอร์</p>
							<p>หน่วยงาน : โปรแกรมเมอร์</p>
							<p>หน่วยงาน : โปรแกรมเมอร์</p>
							<p>หน่วยงาน : โปรแกรมเมอร์</p>
							<p>หน่วยงาน : โปรแกรมเมอร์</p>

							<div class="row">
								<div class="col-md-7">
									ขาดงาน xx วัน<br/>
									ลางาน xx วัน<br/>
									มาสาย xx วัน<br/>