Welcome Guest, Not a member yet? Register   Sign In
Jcrop Library Support for codeIgniter ( part IV ) view

[eluser]Agung Wahyudiono[/eluser]

<?php if(isset($ratio) && isset($orig_w) && isset($orig_h) && isset($target_w) && isset($target_h)): ?>



        aspectRatio: <?php echo $ratio ?>,

        setSelect: [0,0,<?php echo $orig_w.','.$orig_h;?>],

        onSelect: updateCoords,

        onChange: updateCoords



function updateCoords(c)









function showPreview(coords)


    var rx = <?php echo $target_w;?> / coords.w;

    var ry = <?php echo $target_h;?> / coords.h;


    $("#preview img").css({

        width: Math.round(rx*<?php echo $orig_w;?>)+'px',

        height: Math.round(ry*<?php echo $orig_h;?>)+'px',

        marginLeft:'-'+  Math.round(rx*coords.x)+'px',

        marginTop: '-'+ Math.round(ry*coords.y)+'px'



function limiter(textid, limit, infodiv){

    var text = $("#"+textid).val();

    var textlength = text.length;


    if (textlength > limit) {

        $("#"+infodiv).html("You cannot write more then "+limit+" characters!");


        return false;

    } else {

        $("#"+infodiv).html("You have "+(limit - textlength)+" character left !");

        return true;






<?php endif; ?>


<style type="text/css">



        width: <?php echo $target_w?>px;

        height: <?php echo $target_h?>px;




        <div id="containerHolder">

            <div id="container">

                <div id="sidebar">

                    <ul class="sideNav">

                        <li>&lt;?php echo anchor('djawaadmin/feature/list','List') ?&gt;</li>

                        <li>&lt;?php echo anchor('djawaadmin/feature/upload','Upload','class="active"') ?&gt;</li>


                    &lt;!-- // .sideNav --&gt;


                &lt;!-- // #sidebar --&gt;


                &lt;!-- h2 stays for breadcrumbs --&gt;



                   <div id="main" style="padding-bottom:10px;">

                    <h3>Upload Picture for Feature</h3>


                        &lt;?php if(isset($status)){echo $status;}?&gt;


                        &lt;?php if(isset($error_notification)){echo $error_notification.'<br /><br />';}?&gt;

                        &lt;?php if(isset($thepicture)){echo '<div class="imageborder">Original Picture <br /><br /><img src="'.$thepicture.'" id="cropbox" alt="cropbox"></div>';} ?&gt;

                        &lt;?php if(isset($thepicture)){echo '<div style="clear:both; margin-bottom:20px;"></div>';} ?&gt;



                                echo '

                                <div class="imageborder" align="center">

                                    Image Preview for Feature ( Fixed Size 600 x 400 px ) <br /><br />

                                    <div id="preview"><img src="'.$thepicture.'" alt="thumb"></div>

                                </div><br /><br />';




                        &lt;?php if(isset($form)){echo $form;} ?&gt;




                &lt;!-- // #main --&gt;


                <div class="clear"></div>


            &lt;!-- // #container --&gt;



        &lt;!-- // #containerHolder --&gt;

and This is for the view.
At Last iwll say...
This library has alot of weaknes , so I want you to give contribution for this library.

Theme © iAndrew 2016 - Forum software by © MyBB