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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,658
» Latest member: mashhadd
» Forum threads: 66,776
» Forum posts: 418,543

Full Statistics

Latest Threads
Delay in ajax response ti...
Forum: General Help
22 minutes ago
» Replies: 0   » Views: 8
Does the controller name ...
Forum: CodeIgniter 4 Discussion
4 hours ago
» Replies: 0   » Views: 24
Improve Pagination CI 3x
Forum: CodeIgniter 3.x
5 hours ago
» Replies: 2   » Views: 143
use active records in lib...
Forum: General Help
7 hours ago
» Replies: 1   » Views: 32
input post empty
Forum: General Help
Yesterday, 02:29 PM
» Replies: 9   » Views: 223
Dynamic Meta Description
Forum: General Help
Yesterday, 10:26 AM
» Replies: 1   » Views: 78
redis driver _get_lock se...
Forum: Issues
Yesterday, 09:05 AM
» Replies: 6   » Views: 166
Release date for 3.2.0?
Forum: CodeIgniter 3.x
Yesterday, 09:01 AM
» Replies: 1   » Views: 125
How do you access the $th...
Forum: CodeIgniter 4 Discussion
10-20-2017, 08:25 PM
» Replies: 7   » Views: 353
new User of CodeIgniter
Forum: Lounge
10-20-2017, 07:57 PM
» Replies: 2   » Views: 137

 
  What to return in controller
Posted by: romankubis - 10-18-2017, 01:39 AM - Forum: Model-View-Controller - Replies (2)

Hello.
I would like to ask, what to return in controller if I am expecting XMLHttpRequest but request is not XMLHttpRequest.
I have something like this:


Code:
public function show_post($id)
{
 if (!$this->input->is_ajax_request())
   return false;
 ...
 $data = $this->some_model->post($id);
 return json_encode($data);
}

Is it good to return false or return other value?
Thank you.


  CSZCMS 1.1.8
Posted by: Ponchale - 10-17-2017, 06:24 PM - Forum: Addins - No Replies

CSZ CMS upgrade news about version 1.1.8, Have many bug to fixed and add new feature. We improve the performance.

[Image: 1503069696_1-org.png]

RELEASE NOTES FOR 1.1.8
  • Add more meta tag field on content page.
  • Add plugin frontend view for support the custom template.
  • Add content support with [? startform_post:form_name{action_url}][/? endform] and [? startform_get:form_name{action_url}][/? endform].
  • Add widget xml for album view in gallery plugin.
  • Add Form Builder with upload files option and can sort the field on form edit page.
  • Add test send email to default email in 'Site Settings'.
  • Add export and import function on backend with CSV file.
  • Add uninstall the plugin function on plugin store and plugin search.
  • Add file manager for template and cms config (elFinder).
  • Add member frontend view for support the custom template.
  • Add app manifest (add to homescreen) on mobile for backend.
  • Add static frontend view for support the custom template (Error 404, Banner, Linkstats).
  • Add template generater tools in file manager page on backend.
  • Add startup function for run after login. For plugin config $plugin_config['backend_startup'] and $plugin_config['frontend_startup'].
  • Add facebook page id in Site Settings.
  • Add static resources from a different cdn domain setting in Site Settings.
  • Update TinyMCE to 4.6.6.
  • Update Codeigniter to 3.1.6.
  • Improve performance.
  • Support with APC or Memcached or Redis.
  • Improve seo support.
  • Improve IP deny system for CSRF and Brute Force attack.
  • Fixed article rss feed to support 'Facebook Instant Articles'.
  • Fixed for error 404 override page.
  • Fixed for hosting been disabled allow_url_fopen.
  • Fixed article plugin bug.
  • Fixed plugin backend language to default when the language file not found.
  • Fixed the csz cms version checking on plugin store. The plugin can't update if not upgrade the csz cms.
  • Fixed for curl error 60 on windows when the php been disabled allow_url_fopen.
  • Fixed default page with plugin and pages content.
This upgrade has many bug to fixed and add new feature.
This version available now. Please check your backend system to upgrade.
If you find the bug for CSZ CMS. Please tell us at here

Page on SourceForge


  Migration to Codeigniter 3 from 2
Posted by: pbiffar - 10-17-2017, 11:57 AM - Forum: Jobs - Replies (2)

We are based in California and are looking for a developer to help us to migrate to Codeigniter 3 from 2 along these 21 Steps .. . https://www.codeigniter.com/user_guide/installation/upgrade_300.html

We are looking for someone experienced, based in North America to go through our CI2 application and update it to the CI3 requirements, then to upgrade us to 3. For example all our classes would need to be renamed to begin with a capital letter. We have 2 applications (admin, user) each with about 40 controllers and 40 models. 

We also would like to review our security and see how we can strengthen the code utilizing CI 3 features.

Please only contact us if you have solid EXPERIENCE with CI, and can provide evidence of that.


  Proper use of join
Posted by: glorsh66 - 10-17-2017, 11:10 AM - Forum: General Help - Replies (2)

I got a problem - when i use code like this one

Code:
$this->db->select('u.id, u.username, c.name', false);
$this->db->from('user as u');
$this->db->join('companies as c', 'u.company_id = c.id');
$this->db->where('LOWER(u.username)=', strtolower('foobar'));
$query = $this->db->get();

i loose all my id.
I tried to change names of id fields to something like user_id, but CI don't work well without column named precisely id.

How to don't loose id field?
And is possible to get an object representation after a querry that uses a join statement?
$query->custom_result_object(self::$this_table_name);


  count_all_results() - is it optimized?
Posted by: glorsh66 - 10-17-2017, 10:56 AM - Forum: General Help - No Replies

So what is faster? $this->db->count_all_results()
or manually write a query and get count result?


  Codeigniter duplicate session issue
Posted by: kinje - 10-17-2017, 07:15 AM - Forum: Regional User Groups - Replies (6)

I have an application built with codeigniter using the sessions class and storing session data in a database.but when I login into the system with different user and different COMPUTER and Browser, I wonder why all users have the same session data as the first login into the system.


SESSION CONFIGURATION

$config['sess_driver'] = 'database';

$config['sess_cookie_name'] = 'ci_session';

$config['sess_expiration'] = 600;

$config['sess_save_path'] = 'ci_sessions';

$config['sess_match_ip'] = FALSE;

$config['sess_time_to_update'] = 30;
$config['sess_regenerate_destroy'] = TRUE;

I attached a database file
please needs help



Attached Files Thumbnail(s)
   

  Multilication Operation in my CI app with jquery
Posted by: johnCI - 10-17-2017, 03:22 AM - Forum: General Help - No Replies

Hi,
i need your help. i'd like to implement a multiplication operation to obtain missions fees for employees in my CI app.
these are variables : RANG, PERDIEM, NUITS
what i want is when the user choose item "RANG" of employee from the selectbox then  the selectbox " VILLE" appear, when he choose  item "AUTRE VILLE", the "PERDIEM" fees that appear automatically is 75.000 , if he choose item BOUAKE then amout that appear automatically is 100.000. after that he enter a value in the input "NUIT" and automatically a calcul is performed to show the total amout "MONTANT TOTAL DES FRAIS DE MISSION";
the "MONTANT TOTAL" change according to the value choosed in the selectbox "PERDIEM" (this one depends on the choice of the selectbox "VILLE") and the value set in "NUITS".

this is the mathematical operation performed : MONTANT TOTAL = PERDIEM x NUITS

how can i perform that operation in JQUERY?
this is my code:

MY HTML CODE

Code:
<div class="form-group">
                                                     
                           <div class="col-sm-2">
                               <select name="missionnaire1_rang" id="missionnaire1_rang" class="form-control" placeholder="Rang">
                                   <option value=""></option>
                                   <option value="Directeur" <?php
                                   if (!empty($appfond_info->missionnaire1_rang)) {
                                       echo $appfond_info->missionnaire1_rang == 'Directeur' ? 'selected' : '';
                                   }
                                   ?> class="smartfm-ctrl" data-show-id="ctr_directeur">DIRECTEUR</option>
                                   <option value="Sous Directeur" <?php
                                   if (!empty($appfond_info->missionnaire1_rang)) {
                                       echo $appfond_info->missionnaire1_rang == 'Sous Directeur' ? 'selected' : '';
                                   }
                                   ?> class="smartfm-ctrl" data-show-id="ctr_sous_directeur">SOUS DIRECTEUR</option>
                                   
                               </select>
                           </div>
                           <div id="ctr_directeur" class="hiddenbox">
                                <div class="col-sm-2">
                               <select name="missionnaire1_ville" id="missionnaire1_ville" class="form-control select_box" placeholder="Ville">
                                   <option value=""></option>
                                   <option value="Autre" <?php
                                   if (!empty($appfond_info->missionnaire1_ville)) {
                                       echo $appfond_info->missionnaire1_ville == 'Autre' ? 'selected' : '';
                                   }
                                   ?>class="smartfm-ctrl" data-show-id="ctr_directeur_autre_ville">AUTRE VILLE</option>
                                   <option value="Bouaké" <?php
                                   if (!empty($appfond_info->missionnaire1_ville)) {
                                       echo $appfond_info->missionnaire1_ville == 'Bouaké' ? 'selected' : '';
                                   }
                                   ?> class="smartfm-ctrl" data-show-id="ctr_directeur_bouyamsan">BOUAKE</option>                                
                               </select>
                           </div>
                           </div>
                           <div>
                               <div class="col-sm-2" id="ctr_directeur_autre_ville">
                                   <select name="missionnaire1_perd" id="missionnaire1_perd" class="form-control select_box" placeholder="Perdiem">
                                       <option value="75000" <?php
                                       if (!empty($appfond_info->missionnaire1_perd)) {
                                           echo $appfond_info->missionnaire1_perd == '75 000' ? 'selected' : '';
                                       }
                                       ?>>75 000</option>
                                   </select>
                               </div>
                               <div class="col-sm-2" id="ctr_directeur_bouyamsan">
                                   <select name="missionnaire1_perd" id="missionnaire1_perd_bouyamsan" class="form-control select_box" placeholder="Perdiem">
                                       <option value="100000" <?php
                                       if (!empty($appfond_info->missionnaire1_perd)) {
                                           echo $appfond_info->missionnaire1_perd == '100 000' ? 'selected' : '';
                                       }
                                       ?>>100 000</option>
                                   </select>
                               </div>
                           </div>
                           <div class="col-sm-1">
                               <input type="text" name="missionnaire1_nuit" id="missionnaire1_nuit" class="form-control" placeholder="nuit" value="<?php
                               if (!empty($appfond_info->missionnaire1_nuit)) {
                                   echo $appfond_info->missionnaire1_nuit;
                               }
                               ?>" />
                           </div>
                           <div class="col-sm-2">
                               <input type="text" name="missionnaire1_total" id="missionnaire1_total" class="form-control" placeholder="total partiel" value="<?php
                               if (!empty($appfond_info->missionnaire1_total)) {
                                   echo $appfond_info->missionnaire1_total;
                               }
                               ?>" />
                           </div>
                       </div>
________
MY JQUERY CODE
Code:
       var missionnaire1_nuit = $("#missionnaire1_nuit").val();
       var missionnaire1_total = 0;
       if($('#missionnaire1_perd :selected').val() == 75000)
       {
           var missionnaire1_perd = $("#missionnaire1_perd").val();
           missionnaire1_total = missionnaire1_perd * missionnaire1_nuit;
       }else if($('#missionnaire1_perd_bouyamsan :selected').val() == 100000){
           var missionnaire1_perd_bouyamsan = $("#missionnaire1_perd_bouyamsan").val();
           missionnaire1_total = missionnaire1_perd_bouyamsan * missionnaire1_nuit;
       }
       $("#missionnaire1_total").val(missionnaire1_total);


Star Css output screen on browser
Posted by: Mike - 10-17-2017, 01:47 AM - Forum: General Help - No Replies

Hallo master ,i'm new in codeigniter n i have problem with css screen output, when i click menu nav the output got affected but when i click another menu such: profile or contact menu it is not affect, why???? i use template lib n i got it from jerome jaglale, my file like this :  in the views

Code:
<div id="menu">
  <ul>
    <li><?php echo anchor('', 'home');?></li>
    <li><?php echo anchor('welcome/profile', 'profile');?></li>
    <li><?php echo anchor('welcome/contact', 'contact');?></li>
  </ul>
</div>
n my css i use internal css
Code:
Body{
Background-image: url(css/image/pattern.png);

Somebody please help thanks....


  HELP NEEDED: recreating the cause of Travis' current test failures
Posted by: kilishan - 10-16-2017, 09:06 PM - Forum: CodeIgniter 4 Development - Replies (9)

Hey everyone - TravisCI is currently failing in all cases on one specific test: testing creating db tables. The only problem is that I cannot recreate that locally.

I've got both a MAMP/MySQL and a Homestead/MariaDB installs and that test passes in both environments.

Can anyone try their systems and see if the tests pass for you? I can't resolve this without recreating it, unfortunately.

Thanks!


  Import CSV/Excel data into MYSQL database using codeigniter
Posted by: Var91 - 10-16-2017, 07:58 PM - Forum: General Help - Replies (3)

Hello Friends,
Today i came across a functionality where i need to import the CSV/Excel file in to MYSQL database via codeigniter. There is a special requirement from client where he can upload the CSV/Excel file in file upload field in HTML form and all data from CSV/Excel must import into MYSQL database table through PHP and remove the duplicates rows of data.But I faced some problems here.

My problems is:
       1.when the user upload the csv file,its enter into the MYSQL database,but it have duplicates data of about 3-4 row.
       2. the data in csv file is about 8000 rows but the data insert in MYSQL db is only about 5000(included the duplicates             data)
       3.this error occur when the file stop import the data
          importcsv_error
[Image: view?usp=sharing]
this is my view:

Code:
<!-- UPDATE PROCESS'S OUTPUT -->
<div style="display: none;" id="modal3" class="modal hide in" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">Update Process's Output</h3>
    </div>
<form action="{$path}pro/processupload" method="post" enctype="multipart/form-data" name="form1" id="form1">
<table>
<tr>
<td> Choose your file: </td>
<td><input type="file" class="form-control" name="userfile" id="userfile"  align="center"/>
</td>
<td>
<div class="modal-footer">
<td colspan="2" ><input type="submit" id="submit" name="submit" value="Import"></td>
</div></td></tr></table>
</form>
</div><!-- end add product code-->
 this is my controller
PHP Code:
function processupload()
{
    
    
$this->load->model('upload_services');
$data['result']=$this->upload_services->upload_sampledata_csv();
$data['query']=$this-> upload_services->get_car_features_info();
$this->load->view(' Upload_csv ',$data);


and this is my model
PHP Code:
<?php
class Upload_services extends CI_Model
{
function 
__construct()
{
parent::__construct();
}
function 
upload_sampledata_csv()
{
    
if(isset(
$_POST['submit'])){
$fp fopen($_FILES['userfile']['tmp_name'],'r') or die("can't open file");


while((
$line fgetcsv($fp)) !== FALSE)
{
    
    
 
//check whether there are duplicate rows of data in database
 
               $prevQuery = array(
                                    
'articleno'=> $line[0] ,
                                    
'product_description' => $line[1] ,
                                    
'cust_name' => $line[2] ,
                                    
'size' => $line[3] ,
                                    
'colour' => $line[4],
                                    
'process_description' => $line[5],
                                    
'output' => $line[6],
                                    
'material_part' => $line[7],
                                    
'printingOutput' => $line[8]
                                    
                                    );
                                    
                
$q=$this->db->select('sindi_productprocess_temp'$prevQuery)
                 
           ->where('articleno',$line[0],
                                    
'product_description'$line[1] ,
                                    
'cust_name' $line[2] ,
                                    
'size'$line[3] ,
                                    
'colour' $line[4],
                                    
'process_description' $line[5],
                                    
'output'$line[6],
                                    
'material_part'$line[7],
                                    
'printingOutput'$line[8]);
                
 
               $prevResult $this -> db->query($q);
                
 
               if($prevResult->num_rows 0){
 
                   //update process data
                    
                    
$data = array(
                                
'articleno' => $line[0] ,
                                    
'product_description' => $line[1] ,
                                    
'cust_name' => $line[2] ,
                                    
'size' => $line[3] ,
                                    
'colour' => $line[4],
                                    
'process_description' => $line[5],
                                    
'output' => $line[6],
                                    
'material_part' => $line[7],
                                    
'printingOutput' => $line[8]
                                
                                );
                                
                    
                    
$this->db->set
                    
(
                                    
'articleno',$line[0],
                                    
'product_description'$line[1] ,
                                    
'cust_name' $line[2] ,
                                    
'size'$line[3] ,
                                    
'colour' $line[4],
                                    
'process_description' $line[5],
                                    
'output'$line[6],
                                    
'material_part'$line[7],
                                    
'printingOutput'$line[8]
                    );
                    
                    
$this->db-where
                    
(
                                    
'articleno',$line[0],
                                    
'product_description'$line[1] ,
                                    
'cust_name' $line[2] ,
                                    
'size'$line[3] ,
                                    
'colour' $line[4],
                                    
'process_description' $line[5],
                                    
'output'$line[6],
                                    
'material_part'$line[7],
                                    
'printingOutput'$line[8]
                    );    
                    
 
                   $this->db->update('sindi_productprocess_temp');
                    
                    
 
               }else{
                for(
$i 0$j count($line); $i $j$i++)
 
           {    
 
                    $data = array(
                                    
'articleno' => $line[0] ,
                                    
'product_description' => $line[1] ,
                                    
'cust_name' => $line[2] ,
                                    
'size' => $line[3] ,
                                    
'colour' => $line[4],
                                    
'process_description' => $line[5],
                                    
'output' => $line[6],
                                    
'material_part' => $line[7],
                                    
'printingOutput' => $line[8]
                
 
              );
             
 
            $data
['crane_features']=$this->db->insert('sindi_productprocess_temp'$data);
 
               }
                 
$i++;
            }
}
fclose($fp) or die("can't close file");

}
}
function 
get_car_features_info()
{
$get_cardetails=$this->db->query("select * from sindi_productprocess_temp");
return 
$get_cardetails;
}

Can anybody  pls assists me on this?I really need urgent help Sad Sad



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