Feb 142016
 

php convert base64 to image

Assalamu’alaikum wr wb

Bagaimana cara convert base64 menjadi file gambar, itu yang sering saya pikirkan beberapa hari ini. berikut akan saya bagikan cara convert dengan menggunakan php.

function base64_to_jpeg($base64_string, $output_file) {
        $ifp = fopen($output_file, "wb");
        $data = explode(',', $base64_string);
        if(count($data)>0){
            fwrite($ifp, base64_decode($data[1]));
        }else{
            fwrite($ifp, base64_decode($data[0]));
        }
        fclose($ifp);
        return $output_file;
}

Itu source yang bisa dipakai untuk menggunakannya seperti contoh di abah ini

base64_to_jpeg($_POST[‘string_base64’], ‘file.jpg’ )

Silakan dimanfaatkan sesuai dengan kebutuhan, semoga membantu.

Wassalamu’alaikum wr wb

Apr 302015
 

Multi Application on Codeigniter

Assalamu’ alaikum wr wb

Kabar gembira dari codeigniter versi 3 yang ada versi terdahulu kita agak kerepotan saat ingin membuat aplikasi yang membutuhkan beberapa plikasi didalanya kita harus membuat beberpa sub aplikasi yang mungkin akan membuat kita sedikit repot seperti yang pernah saya bahas Multi app with CodeIgniter. Pada codeigniter versi 3 telah menyediakan kemudahan yaitu dengan memperbolehkan kota untuk mebuat subfolder dalam controller.

contoh

application/controllers/subfolder/Namacontroller.php

maka kita dapat memanggilnya dengan

http://webserver/index.php/subfolder/namacontroller/function

Bagaiaman lebih mudah kan. selamat berexploreasi

sumber : Codeigniter [Organizing Your Controllers into Sub-directories]

Wassalamu’alaikum wr wb

May 212013
 

CRUD (Create Read Update Delete) with CodeIgniter

Assalamu’ alaikum wr wb

Untuk Sekedar pemanasan mari kita buat aplikasi CRUD di CI. Untuk lebih lengkapnya silakan download script source di bawah ini :

Download

Wassalamu’ alaikum wr wb

Oct 122012
 

Assalamu’ alaikum wr wb

Ternyata http://u.kaskus.co.id/ pake CI (CodeIgniter)

kaskus

Saya tadi tidak sengaja menemukan halaman error pada http://u.kaskus.co.id/  yang ternyata masih pake default error pada CodeIgniter . brikut penampakannya.

Error

Wassalamu’ alaikum wr wb

Nov 042011
 

Assalamu’ alaikum wr wb

Lowogan

Wassalamu’ alaikum wr wb

Aug 302011
 

Assalamu’ alaikum wr wb

CRUD ExtJs 4 With CodeIgniter

ExtJS

ExtJS

Selamat Berpuasa bagi yang masih berpuasa dan Mohon maaf lahir batin buat teman – teman yang sudah merayakan Idul Fitri. Untuk menepati beberapa janji saya kepada teman – teman, yang menginginkan tutorial dan controh scrip CRUD dengan ExtJS maka akan saya bagikan sedikit tutorial tentang CRUD pada ExtJS.4 dengan menggunakan framework CodeIgniter 1.7.2.

Langsung pada permasalahan, tutorial ini masih berhubungan dengan tutorial saya yang kemaren, yang membahas tentang tree ExtJs karena databasenya masih menggunakan yang ada. yaitu treemenu.

Create table :

CREATE TABLE tbl_menu (
MN_ID int(11) NOT NULL AUTO_INCREMENT,
MN_NAME varchar(30) DEFAULT NULL,
MN_LINK varchar(50) DEFAULT NULL,
MN_PARENT int(11) DEFAULT NULL,
MN_GRP int(11) DEFAULT NULL,
MN_SORT int(11) DEFAULT NULL,
MN_STATUS int(11) DEFAULT NULL,
MN_ICON varchar(50) DEFAULT NULL,
MN_TYPE int(11) DEFAULT NULL,
PRIMARY KEY (MN_ID)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=latin1

Continue reading »

Jan 312011
 

CodeIgniter 2.0.0 Released

Today EllisLab and the CodeIgniter Reactor Engineers are proud to announce the first official release of CodeIgniter 2.0.0, which is being released in two flavors:

CodeIgniter Core

Core is a slow-moving branch that will be used as the base for EllisLab commercial products such as ExpressionEngine and MojoMotor. It will continue at a similar pace that CodeIgniter has in the past and will be useful for large commercial applications that require the upmost in stability and backward/forward compatibility at a pace more typical of SLA backed Enterprise products.  Core is publicly available with tagged downloads at BitBucket.

CodeIgniter Reactor

Reactor is a community driven branch of CodeIgniter that will enable faster adoption of the best community submitted code to the framework. This means the community can create a fork of the project on BitBucket and contribute bug fixes, new features, documentation improvements, etc and have it reviewed by a code-review team called Reactor Engineers. These Engineers are primarily responsible for driving the development of the framework.

Changes and features made by EllisLab to Core will be merged into Reactor, and EllisLab will actively contribute to Reactor’s development.  Reactor is the recommended version of CodeIgniter for use in the majority of day to day work. When you see “CodeIgniter” by itself on this web site, it is referring to CodeIgniter Reactor.  The downloads, documentation, and forums all reflect this change.  Put simply, Reactor = CodeIgniter.

Some of the big changes to happen in CodeIgniter 2.0 since CodeIgniter 1.7.3 are:

  • Support for PHP 4 is gone, PHP 5.1 is now a requirement.
  • CSRF Protection built into the form helper
  • Drivers
  • Application Packages
  • Scaffolding, having been deprecated for a number of versions, has been removed.
  • Removed the deprecated Validation Class.
  • Plugins have been removed, in favor of Helpers.
  • Added routing overrides to the main index.php file, enabling the normal routing to be overridden on a per “index” file basis.
  • Added $route[‘404_override’] to allow 404 pages to be handled by controllers.
  • 50+ bugs fixed

Reactor contains all of these above and some nice changes of its own:

  • Full query-string support
  • Automatic base_url detecion if left blank
  • New Cache driver with file system, APC and memcache support
  • Command line compatibility for easy cron jobs
  • 20+ tweaks and improvements

Have a look at the change log for the full list of improvements and enhancements.

The Engineer team is also working on, or close to completing these features for a future Q1 release:

User Guide Note Contribution

Users will soon be able to contribute notes to each page in the user guide in the fashion that php.net currently allows. This will make CodeIgniter’s already-extensive documentation even more useful as time goes on. The new comment system is versioned, which will allow obsolete comments to be pruned from newer version without affecting older ones.

Authentication Driver

A common request for a long time (and with almost 800 votes on UserVoice) is an Authentication library. This is something we would like to do if the right solution and approach can be found, but it will take time and a lot of work to make a solution generic enough for everyone without being overly complex.

A More Object-like Model

A backward-compatible tweak currently in testing is a feature that allows active-record results to be returned as instances of the models they represent. This will allow for a more semantic approach to dealing with database rows.

CodeIgniter is now a much more community-oriented framework than it has been in the past. You can submit pull requests via BitBucket or Phil’s GitHub mirror. You’ll also see new releases far more frequently.

What are you waiting for?  Download it now and start cloning!

– The Reactor Team

Sumber : http://codeigniter.com/news/codeigniter_2.0.0_released/

Oct 092010
 

Dinamis TreePanel ExtJs

Assalamu’ alaikum wr wb

Bebearapa saat yang lalu ada beberapa teman bertanya tentang bagaimana menggunakan TreePanel di ExtJs. Beberapa hari ini saya membuka – buka coding ExtJs dan php saya yang jadul dengan menggunakan ExtJs v 2. Tapi disitu saya menemukan sesuatu yang bagus untuk di bahas dalam tulisan saya kali ini.

Langsung pada tujuan kadang kita ingin membuat atau load tree dari sebuah query database. Saya yakin semua pasti bisa untuk membuatnya. Tapi disini bagaimana cara kita membuat aplikasi kita tidak terlalu berat saat load data.

Semisal ada kasus seperti ini.

1. saya mempunyai sebuah table dengan nama tbl_admin_menu dengan sis sebagai berikut :

setelah itu kita buat scrip phpnya dengan frame work CodeIgniter (CI).

Controller :

class menu_admin extends Controller {

    //put your code here
    function __construct() {
        parent::Controller();
        $this->load->model('menu_admin_model');
    }

    function getTreeMenu() {
        $arr_value = Array();
        if ($_POST['node'] == 'root') {
            $result = $this->menu_admin_model->getTreeMenu(0);

            foreach ($result->result_array() as $row) {
                if($row['TYPE']==0)
                    $arr_value[] = array(
                        'id'            => $row['ID_MENU'],
                        'text'          => $row['NAME_MENU'],
                        'iconCls'       => $row['ICON']
                    );
                else
                    $arr_value[] = array(
                        'id'            => $row['ID_MENU'],
                        'text'          => $row['NAME_MENU'],
                        'iconCls'       => $row['ICON'],
                        'leaf'          => true
                    );
            }
        }else{
            $result = $this->menu_admin_model->getTreeMenu($_POST['node']);

            foreach ($result->result_array() as $row) {
                if($row['TYPE']==0)
                    $arr_value[] = array(
                        'id'            => $row['ID_MENU'],
                        'text'          => $row['NAME_MENU'],
                        'iconCls'       => $row['ICON']
                    );
                else
                    $arr_value[] = array(
                        'id'            => $row['ID_MENU'],
                        'text'          => $row['NAME_MENU'],
                        'iconCls'       => $row['ICON'],
                        'leaf'          => true
                    );
            }
        }
        $this->jsonci->sendJSONNew($arr_value);
    }
}

Buat Sctip untuk Model

class menu_admin_model extends Model{
    //put your code here
    function __construct() {
        parent::Model();
    }

    /**
     *
     * @param <type> $PARENT
     */
    function getTreeMenu($PARENT){
        $this->db->select('*');
        $this->db->from('tbl_menu_admin');
        $this->db->where('PARENT',$PARENT);
        $query = $this->db->get();
        return $query;
    }
}

Lalu yang terakhir adalah mebuat scrip ExtJs nya

var treePanel = new Ext.tree.TreePanel({
    renderTo	: 'divID',
    loader:new Ext.tree.TreeLoader({
        dataUrl:'<?php echo base_url(); ?>index.php/menu_admin/getTreeMenu'
    }),
    root: new Ext.tree.AsyncTreeNode({
        text    : 'Main Menu',
        id      : 'root',
        expanded: true,
        iconCls : 'home'
    })
})

Hasil : Selamat mencoba semoga membantu.

Wassalamu’ alaikum wr wb

Jun 222010
 

Assalamu’ alaikum wr wb

Mohon maaf kepada semua cucu – cucu 😀 yang sering berkunjung ke blog saya kemaren sempat blog ini mati, maaf lupa belum perpanjang. Terimakasih kepada saudara/adik saya qu4ck yang telah banyak membantu.

Saya kemaren malam sambil sedikit ngantuk telah membuat vidio kelanjutan dari yang kemaren yaitu tutorial ExtJS dan CodeIgniter.

Download

Semoga tutorial ini dapat mebantu teman – teman semua yang lagi suka dengan ExtJS dan CodeIgniter

Wa’ alaikum wr wb