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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 11,091
» Latest member: a3lanjo
» Forum threads: 67,623
» Forum posts: 422,763

Full Statistics

Latest Threads
javascript in Extension e...
Forum: General Help
18 minutes ago
» Replies: 0   » Views: 6
Cannot Pass More than two...
Forum: Model-View-Controller
34 minutes ago
» Replies: 4   » Views: 81
ci-phpunit-test for CodeI...
Forum: Addins
1 hour ago
» Replies: 87   » Views: 55,204
custom helper function
Forum: Model-View-Controller
1 hour ago
» Replies: 4   » Views: 137
Lost session
Forum: CodeIgniter 4 Support
2 hours ago
» Replies: 13   » Views: 232
Unable to locate the spec...
Forum: General Help
2 hours ago
» Replies: 8   » Views: 169
Share PHP Sessions across...
Forum: General Help
2 hours ago
» Replies: 1   » Views: 52
can't get link to work
Forum: General Help
2 hours ago
» Replies: 35   » Views: 13,975
Validation error messages...
Forum: General Help
3 hours ago
» Replies: 2   » Views: 51
Security with CI
Forum: Best Practices
3 hours ago
» Replies: 5   » Views: 536

 
  javascript in Extension event not firing
Posted by: richb201 - 18 minutes ago - Forum: General Help - No Replies

I am trying to get the "week" input control working in my Extension popup.js file. Here is the def


    <label for="week">What week?</label>
    <input id="week" type="week" name="week" value="2017-W01" onchange="set_theweek()">



In my popup.js file I have a function:

    //sets the week control to this week 
    function set_theweek()
    {
   var currentTime = new Date();      <<breakpoint on this line
   var week=getWeek(currentTime);
   } 

I can display the week "picker" fine. When I change the date in "week", I thought that set_theweek() would execute, but it doesn't. I have a breakpoint that never fires. All the examples of using "week" seems to POST to the backend. In my case, since this is an Extension, I can't do that. I just want to find out what week the user set the control to. Any ideas why my callback isn't working?

I also tried changing the event in the html file to oninput.  I am getting the following error:

Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

What does this mean?


  Question For SMS
Posted by: a3lanjo - 3 hours ago - Forum: Libraries & Helpers - No Replies

How integration SMS APIs with codeigniter, The API am used as below :

http://demowebsite/demo.cfm?numbers=962770692825&senderid=sendername&AccName=myusername&AccPass=mypassword&msg=texthere&requesttimeout=5000000


  Validation error messages below or beside fields
Posted by: danangeloalcanar - Yesterday, 07:53 PM - Forum: General Help - Replies (2)

Hi CI community,

I have a simple question, but I can't produce the answer however I tried to think of it.

Here is my scenario:

I have a registration form. So users fill it out.

Now, if the validation criteria was not satisfied, the form will show validation errors right? 

Code:
<?php echo validation_errors(); ?>
The error messages will display above the form, right?

Now, here is what I want to accomplish. 

I want to show the error for each field, just below the field.

For example, I have a validation rule for the username, that it must be at least 6 characters long. If the user inputs 4 characters only,
I want the error to show just below the field. 

So if  I have error messages for username field and password field, the error messages for the username field will show below the username field, and the error messages for the password field will show below the password field. at the same time.

Now, here's a solution I am thinking but I don't know if it is the right way.

I will just set a flashdata for each field? and if it is set, I will just show it  like this:

Code:
if ($username < 6) {
    $this->session->set_flashdata('is_less_than_six', 'Username must be at least 6 characters long.');
}

And then create a span element below the username field:
Code:
if ($this->session->flashdata('is_less_than_six')) {
    echo $this->session->flashdata('is_less_than_six');
}

Is that a good solution? We know it will work, but how about repopulation the fields?

Hope you can guide me guys. I want to make my validation errors understandable to the users. Thankyou.

Cheers!

-Dan


  Share PHP Sessions across sub domains
Posted by: cosmo - Yesterday, 12:31 PM - Forum: General Help - Replies (1)

I am trying to set up the following:

Code:
auth.domain.com
sub1.domain.com
sub2.domain.com

where if the user visits sub1.domain.com or sub2.domain.com and they are not logged in, they get pushed over to auth.domain.com and can log in. sub1.domain.com and sub2.domain.com are two separate applications but use the same credentials.

I tried setting the following in my php.ini:

Code:
session.cookie_domain = ".domain.com"

but it doesn't seem to be passing the information from one domain to the other.


  Cannot Pass More than two variable to view
Posted by: sanjaya - Yesterday, 11:18 AM - Forum: Model-View-Controller - Replies (4)

Hello,
 I try to get total of price column in personal assets table. But I have below error.. 

A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: employee/inventory.php
Line Number: 61
Backtrace:
File: C:\wamp64\www\MY\admin\application\views\employee\inventory.php
Line: 61
Function: _error_handler

File: C:\wamp64\www\MY\admin\application\controllers\Employee.php
Line: 223
Function: view

File: C:\wamp64\www\MY\admin\index.php
Line: 315
Function: require_once


My Model: 

PHP Code:
<?php

Class Employee_model extends CI_model
{
    public function 
__construct()
    {
        
parent:: __construct();
    }

public function 
view_data($id)
 
   {
 
       $query $this->db->query("SELECT
               sgh.employee.id,
               sgh.employee.employee_name,
               sgh.employee.designation,
               sgh.employee.join_date,
               sgh.employee.b_day,
               sgh.employee.address,
               sgh.employee.mobile_number,
               sgh.employee.photo,
               sgh.company.company_name,
               sgh.employee.company_id
               FROM
               sgh.company,
               sgh.employee WHERE sgh.employee.company_id=sgh.company.id AND sgh.employee.id='
$id'");
 
       $employee_data $query->row();
 
       return $employee_data;

 
   }

 
   public function view_inventory($id){
     
   $query $this->db->query("SELECT sgh.inventory.id,
                                    sgh.inventory.item_name,
                                    sgh.inventory.price,
                                    sgh.inventory.qty,
                                    sgh.inventory.serial_number,
                                    sgh.inventory.product_key,
                                    sgh.employee.id,
                                    sgh.employee.employee_name
                                  FROM sgh.inventory,
                                  sgh.employee WHERE sgh.inventory.employee_id=sgh.employee.id AND sgh.employee.id='
$id'");
     
   $item_data $query->result_array();
 
       return $item_data;
 
   }

 
   function employee_spends($id)
 
   {
 
       $query $this->db->query(" SELECT SUM(price) FROM inventory WHERE employee_id='$id'");
 
       $row $query->row();
 
       return $row;
 
   }


This My Controller
PHP Code:
function personal_inventory($id)
 
   {
 
       $employee_data["row"] = $this->Employee_model->view_data($id);
 
       $inventory_data["item"] = $this->Employee_model->view_inventory($id);
 
       //Total spends for current employee
 
       $inventory_data["total"] = $this->Employee_model->employee_spends($id);
 
       var_dump$inventory_data["total"]);
 
      // var_dump( $inventory_data);
 
       if ($inventory_data["item"]== null) {
 
           $this->load->view('includes/header');
 
           $this->load->view('includes/top_header');
 
           $this->load->view('includes/left_nav');
 
           $this->load->view('error_page/no_records'$employee_data);
 
           $this->load->view('includes/footer');
 
           $this->load->view('includes/settings');
 
       } else {
 
           $this->load->view('includes/header');
 
           $this->load->view('includes/top_header');
 
           $this->load->view('includes/left_nav');
 
           $this->load->view('employee/inventory'$inventory_data);
 
           $this->load->view('includes/footer');
 
           $this->load->view('includes/settings');
 
       }
 
   

This is my view
PHP Code:
<!-- Content WrapperContains page content -->
<
div class="content-wrapper">
 
   <!-- Content Header (Page header) -->
 
   <section class="content-header">
 
    <h2>Personal Inventory Area</h2>
 
   </section>
 
   <!-- Main content -->
 
   <section class="content">
 
       <div class="row">
 
           <div class="col-xs-12">
 
               <div style="margin-bottom: 10px;" >
 
                       <a href="<?= base_url() ?>employee/employee_list/" class="btn btn-info btn-lg">Back
                            to 
List</a>

 
               </div>
 
               <div class="box">
 
                   <div class="box-header">
 
                       <h3 class="box-title">Inventory Items</h3>
 
                   </div>
 
                   <!-- /.box-header -->
 
                   <div class="box-body">
 
                       <table id="example1" class="table table-bordered table-striped table-hover">
 
                           <thead>
 
                           <tr>
 
                               <th>Item Name</th>
 
                               <th>Price</th>
 
                               <th>Quantity</th>
 
                               <th>Serial Number</th>
 
                               <th>Product Key</th>

 
                           </tr>
 
                           </thead>
 
                           <tbody>
 
                           <?php
                            foreach 
($item as $row){
 
                               ?>
                                <tr>
                                    <td><?=$row["item_name"]?></td>
                                    <td class="text-left">Rs. <?=$row["price"]?>.00</td>
                                    <td><?=$row["qty"]?></td>
                                    <td><?=$row["serial_number"]?></td>
                                    <td><?=$row["product_key"]?></td>
                                </tr>
                                <?php
                            
}
 
                           ?>

                            </tbody>
                            <tfoot>
                            <tr>
                                <th>Item Name</th>
                                <th>Price</th>
                                <th>Quantity</th>
                                <th>Serial Number</th>
                                <th>Product Key</th>
                            </tr>
                            </tfoot>
                        </table>
                    </div>
                    <div>
                        <P>Total Spends is <?=$row->price?></P>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper --> 


  CodeIgniter 4 - Brazilian Portuguese (pt-BR) Language Localization
Posted by: natanfelles - 04-20-2018, 07:58 PM - Forum: Regional User Groups - Replies (1)

Hello everyone!

I just translated the CodeIgniter 4 files into the Brazilian Portuguese language.

Certainly some translations will have to be updated until the framework be released. But, right now, you can go testing using multi-languages.

Repository is here: https://github.com/natanfelles/CodeIgniter4-pt-BR

-

Olá a todos!

Eu acabei de traduzir os arquivos do CodeIgniter 4 para o idioma Português Brasileiro.

Certamente algumas traduções terão que ser atualizadas até o framework ser lançado. Mas, desde já, você pode ir testando usando multi-idiomas.

O repositório está aqui: https://github.com/natanfelles/CodeIgniter4-pt-BR


  securimage and ci
Posted by: im.amideb - 04-20-2018, 02:17 PM - Forum: Libraries & Helpers - No Replies

hello,

i am trying to integrate securimage with ci but i always get bool(false).

moreover, $securimage->getCode(); throws // Message: Undefined index: code

any help?

thanks


  How to Integrate Ckeditor and KCFinder on Codeigniter Framework 3..?
Posted by: albait - 04-20-2018, 01:32 PM - Forum: Lounge - Replies (1)

How to Integrate Ckeditor and KCFinder on Codeigniter Framework 3. Please let me know. Thanks!


  Creating you own composer package
Posted by: duongduythao - 04-20-2018, 11:50 AM - Forum: Lounge - No Replies

Hello CI Community!

I am back with a new question.

As we know, sometimes we code something repetitively. For example, I always have a registration module in my project.

So I create a Model for the registration, a Controller and the corresponding Views.

Now, I am thinking.. Can I create a composer package that will include and install these files for me? So I don't have to create new files every time I start a new project.

For example, I started a new project and I need a registration module. Now, I will just run  composer require ci-registration

and the package will be installed. All the files will go to their respective folder. 

Is that possible? Have anyone tried that?

I hope I explained myself clearly.

Thankyou so much. Please bear with me. I am a beginner in CI. Hope you can guide me.


  v318 db parser bug (maybe, perhaps)
Posted by: badger - 04-20-2018, 09:03 AM - Forum: Issues - Replies (3)

up to and including v312, i was able to use queries like the following

PHP Code:
SELECT ..... FROM .... WHERE (a.transdate >= "?") AND (p.prva_id>0) AND (p.prod_id=?) 

Today i made the quantum leap to v318 and such queries crash on the part "(p.prod_id=?)".
Now it will only work if i use (p.prod_id="?") ie enclose the question mark in quotes
Switch back to v312 and it's ok
I don't know if this is a bug or if I've just been lucky in always getting away with sloppy coding.
The quotes are needed for e.g. a date or text but I've never had to use them for integers
Bill



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