Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 12,950
» Latest member: yasuo16gg
» Forum threads: 68,997
» Forum posts: 429,297

Full Statistics

Latest Threads
CodeIgniter 3.1.10 Releas...
Forum: News & Discussion
1 hour ago
» Replies: 14   » Views: 5,111
File upload validation wi...
Forum: CodeIgniter 4 Support
10 hours ago
» Replies: 0   » Views: 41
How do i redirect user to...
Forum: CodeIgniter 4 Support
Yesterday, 08:36 AM
» Replies: 1   » Views: 112
Why Codeigniter is better...
Forum: Choosing CodeIgniter
Yesterday, 01:39 AM
» Replies: 13   » Views: 3,217
CI tutorial from David Co...
Forum: Lounge
01-22-2019, 07:44 PM
» Replies: 13   » Views: 1,211
Library: "Dates and Times...
Forum: CodeIgniter 4 Support
01-22-2019, 02:14 PM
» Replies: 2   » Views: 178
Codeigniter database conn...
Forum: General Help
01-22-2019, 10:20 AM
» Replies: 2   » Views: 102
How to deal with large up...
Forum: CodeIgniter 4 Support
01-22-2019, 10:19 AM
» Replies: 3   » Views: 160
Top RSA library for php
Forum: General Help
01-22-2019, 10:19 AM
» Replies: 9   » Views: 208
Project Update 2019.01.04
Forum: News & Discussion
01-22-2019, 02:52 AM
» Replies: 15   » Views: 5,415

 
  Javascript Not Running in iframe Codeigniter 3
Posted by: TemiU - 01-14-2019, 05:15 AM - Forum: General Help - Replies (1)

I am updating a website from CodeIgniter 2 to CodeIgniter 3 (.1.9)

We had an iframe embedded in several pages with javascript in the iframe to, among other things, put in a placeholder for telephone number and set the iframe height dynamically. This was working fine in our CodeIgniter 2 implementation, but the javascript does not seem to be running at all in the CodeIgniter 3 implementation.

The page in which the iframe is embedded (page.php) has the following code:

Code:
<iframe id="iframe_form" src="<?php echo site_url('contact/request_consultation');?>" class="span3" scrolling="no" frameborder="0"></iframe>

The javascript on the actual request_consultation page (which is in the iframe) is as follows:
Code:
<script type="text/javascript">

$(document).ready(function(){

   $(".phone").mask("(999) 999-9999",{placeholder:"_"});
   $('.error').click(function(){
       $(this).removeClass('error');
   });


   $('#iframe_form', window.parent.document).height($('body').height());  

});
//]]>
</script>

I tried moving the code into the page in which the iframe was embedded (page.php), but it did not work. It is entirely possible that I may not have referenced the iframe and/ or its elements correctly:
Code:
document.getElementById("iframe_form").(".phone").mask("(999) 999-9999",{placeholder:"_"});

I also tried giving the 
<div> on the parent page an id: 
Code:
<div id="frame_span" >

 and then referencing the id from the request_consultation page, but that did not work, either.

Code:
$('#iframe_form', window.parent.document).height($('frame_span').height());

Any suggestions would be greatly appreciated.


  Upgrade codeignitor from
Posted by: Knutsford - 01-13-2019, 03:08 PM - Forum: Installation & Setup - Replies (3)

I am trying to upgrade from 2.1.3 to 3.1.9 but I then get "page can not be found". I  test copy of the site under /test which is what I am upgrading first. All I have done so far it to remove the old stuff under /system and put it the 3.1.9 copy of system. I know I need to change the session table layout but I wouldn't have thought that would be the reason. Has anyone got any idea why just upgrading the system files would cause that?  I don't want to touch anything else until I know that is what would be expected.


Hmm I see everything under controller has to start with a capital letter. Is that the same for the modules and Views and any libraries under them.  What about redirects? Are they lowercase still?


  CodeIgniter en Español
Posted by: MisterGeorgeX - 01-13-2019, 11:15 AM - Forum: Regional User Groups - No Replies

Cordial saludo desde Colombia a toda la comunidad de CodeIgniter me complace poder invitarlos formalmente a una comunidad en latino américa exclusiva para CodeIgniter y se llama <<CodeIgniter en Español>> tenemos presencia en Facebook e Telegram nos encantaría poder reunir muchos más de nuestra región y habla hispana, les comaprto los links para que se integren y podamos crecer mucho más y así promover nuestra herramienta de desarrollo.

Facebook: https://www.facebook.com/groups/codeigniter.es

Telegram: https://t.me/CodeIgniterEnEspanol

sin más invitarlos también a que estén al tanto de este enlace: https://codeigniter.es/ donde queremos que todo el contenido oficial del framework esté traducido y al día para ello requerimos que nos unamos y cada uno aporte su granito de arena.

Los esperamos.


  Hello need site support
Posted by: yosiyosi2002 - 01-12-2019, 11:05 PM - Forum: Addins - Replies (3)

Hello need site support - I have a problem with map


  cant use json_encode to entity class
Posted by: khusaeriz - 01-12-2019, 05:36 AM - Forum: CodeIgniter 4 Support - Replies (1)

i use json_encode an entity class but it's just return "{}".


  AFAIK, CI doesn't have a usage reporting feature
Posted by: helenharry - 01-12-2019, 02:36 AM - Forum: Lounge - Replies (1)

I definitely appreciate security patches for the 2.x series. My existing CI sites are all on 2.x and I don't know when I will have time to upgrade them.

AFAIK, CI doesn't have a usage reporting feature, which prevents knowing just how many live 2.x sites are out there.  Is "most have moved on" basically a guess based on current input from those in active development? I didn't even know there was a 3.x until fairly recently, and I would guess there are others who still don't know. Not everyone is actively developing their sites, even if the sites are in production. If you're not actively developing and just letting the site run, it's (too) easy to be disconnected from what else is happening in the world of CodeIgniter.


  What is the default URL pattern used in CodeIgniter?
Posted by: garimapatil - 01-12-2019, 12:23 AM - Forum: Model-View-Controller - Replies (2)

Hi there,
            
            I am a newbie.  I want to know What is the default URL pattern used in CodeIgniter?


Thank you in advance


  Go CI Go
Posted by: php_rocs - 01-11-2019, 07:41 AM - Forum: Lounge - Replies (2)

I was on the internet doing some research and I used a tool by Wappalyzer that discovers used technology of websites.  I happen to see something that caught me eye so I clicked on the link and what did I see...  That CI was on the list.

click link or see attachment.

https://www.wappalyzer.com/categories/web-frameworks

   


  i want to make a chained dropdown
Posted by: pasekb - 01-11-2019, 07:35 AM - Forum: General Help - Replies (3)

hi guys i want to make the chained drop down by using ajax, i have a code but only work when i set the id, when im not set the id that's only showing data at the first dropdown and the next dropdown doesnt show a data

example :
<?php echo combo_provinsi(isset($ongkir['id_provinsi']) ? $ongkir['id_provinsi'] :  1 //the chained dropdown is work when i set this number, number 1 is a meaning of id provinsi  ) ?>

The question is how to make chained drop down without set the id like my code ?, i want chained dropdown is work by selected dropdown without set the id before

here's my full code

VIEW

Code:
<?php echo form_open($form_post_url, array('class'=>'form-horizontal','role'=>'form')); ?>
               <div class="card-body">
                 <div class="form-group">
                   <label for="id_provinsi">Provinsi</label>
                   <?php echo combo_provinsi(isset($ongkir['id_provinsi']) ? $ongkir['id_provinsi'] : 1) ?>
                 </div>
                 <div class="form-group">
                   <label for="id_kabupaten">Kota / Kabupaten</label>
                   <select name="id_kabupaten" id="id_kabupaten" class="form-control">
                     <option value="">-- Pilih Kota / Kabupaten --</option>
                   </select>
                 </div>
                 <div class="form-group">
                   <label for="id_kecamatan">Kecamatan</label>
                   <select name="id_kecamatan" id="id_kecamatan" class="form-control">
                     <option value="">-- Pilih Kecamatan --</option>
                   </select>
                   <?php echo form_error('id_kecamatan') ?>
                 </div>
                 <div class="form-group">
                   <label for="biaya">Biaya Kirim Per Kg</label>
                   <input type="text" name="biaya" id="biaya" class="form-control" placeholder="Tulis Biaya Kirim" value="<?php echo isset($ongkir['biaya']) ? $ongkir['biaya'] : '' ?>">
                   <?php echo form_error('biaya') ?>
                 </div>
               </div>
               <!-- /.card-body -->
               <div class="card-footer">
                 <input type="hidden" name="submit">
                 <input type="hidden" name="id_ongkir" value="value="<?php echo isset($ongkir['id_ongkir']) ? $ongkir['id_ongkir'] : '' ?>"">
                 <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> Simpan</button>
                 <button type="button" onclick="window.history.back()" class="btn btn-default"><i class="fa fa-rotate-left"></i> Batal</button>
               </div>
             </form>
           </div>
           <!-- /.card -->
     </div>
     <!-- /.row (main row) -->
   </div><!-- /.container-fluid -->
 </section>
 <!-- /.content -->
</div>

<script>

 function get_kabupaten(id_prov, sel) {
   $.ajax({
     url: '<?php echo base_url() ?>ajax/get_kabupaten',
     type: 'POST',
     dataType: 'html',
     data: {
       id_provinsi: id_prov,
       selected: sel
     },
     success: function(data) {
       $("#id_kabupaten").html(data);
     }
   });
 }

 function get_kecamatan(id_kab, sel) {
   $.ajax({
     url: '<?php echo base_url() ?>ajax/get_kecamatan',
     type: 'POST',
     dataType: 'html',
     data: {
       id_kabupaten: id_kab,
       selected: sel
     },
     success: function(data) {
       $("#id_kecamatan").html(data);
     }
   });
 }
 <?php if ($title = 'Tambah Biaya Kirim'): ?>
 get_kabupaten($("#id_provinsi").val(), 0);  
 <?php else: ?>

 <?php endif ?>

 <?php if (isset($ongkir['id_kecamatan'])): ?>
     $.ajax({
       url: '<?php echo base_url() ?>ajax/get_kabupaten',
       type: 'POST',
       dataType: 'html',
       data: {
         id_provinsi: $("#id_provinsi").val(),
         selected: <?php echo $ongkir['id_kabupaten'] ?>
       },
       success: function(data) {
         $("#id_kabupaten").html(data);
         get_kecamatan(<?php echo $ongkir['id_kabupaten'] ?>, <?php echo $ongkir['id_kecamatan']!='' ? $ongkir['id_kecamatan'] : 0  ?>);
       }
     });
 <?php endif ?>
 
 $("#id_kabupaten").change(function() {
   get_kecamatan($(this).val(), '');
 });
</script>

AJAX Controller
Code:
public function get_kabupaten()
    {
        if(isset($_POST['id_provinsi']) && isset($_POST['selected']))
        {
            $id_provinsi = $this->input->post('id_provinsi');
            $selected      = $this->input->post('selected');
            
            if($id_provinsi != '')
                $data = $this->alamat->get_kabupaten_by_idprovinsi($id_provinsi);
            
            if($data)
            {
                echo '<option value="">-- Pilih Kota / Kabupaten --</option>';
                foreach ($data as $r) {
                    $sel = '';

                    if($r->id_kabupaten == $selected)
                        $sel = 'selected';
                    echo "<option value='".$r->id_kabupaten."' ".$sel.">".$r->nama_kabupaten."</option>";
                }
            }
            else
            {
                echo '<option value="">-- Pilih Kota / Kabupaten --</option>';
            }
            
        }
    }

    public function get_kecamatan()
    {
        if(isset($_POST['id_kabupaten']) && isset($_POST['selected']))
        {
            $id_kabupaten = $this->input->post('id_kabupaten');
            $selected       = $this->input->post('selected');
            if ($id_kabupaten != '')
                $data = $this->alamat->get_kecamatan_by_idkabupaten($id_kabupaten);
    
            if($data)
            {
                echo '<option value="">-- Pilih Kecamatan --</option>';
                foreach ($data as $r) {
                    $sel = '';
                    if($r->id_kecamatan == $selected)
                        $sel = 'selected';
                    echo "<option value='".$r->id_kecamatan."' ".$sel.">".$r->nama_kecamatan."</option>";
                }
            }
            else
            {
                echo '<option value="">-- Pilih Kecamatan --</option>';
            }    
        }
    }

    public function get_kecamatan_byid()
    {
        $data = $this->alamat->get_kecamatan_full($this->input->post('id_kecamatan'));
        echo json_encode($data);
    }

}


  Sending eMails with CronJob
Posted by: VK4JE - 01-11-2019, 12:52 AM - Forum: Best Practices - Replies (9)

Hi,
I have a script that is run via a cronjob, everything works fine except for: 
$this->email->to($user->mail);

The eMail to [email protected] works fine

                $this->load->library('email');
                $config_mail['mailtype'] = 'html';
                $this->email->initialize($config_mail);
                $this->email->from($settings['noreply'], 'True Blue Locals');
                $this->email->to($user->mail);

                $this->email->to("[email protected]");

Just wondering if there is something wrong with the formatting.

Any guidance will be appreciated

Cheers
Ron



  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.