codeigniter

PHP remove array if subarray empty

做~自己de王妃 提交于 2021-01-29 15:54:19
问题 my array image just like this, if subarray "name" is empty or null i want delete array, how to do that ? here my current script $data = array(); $fixedData = array(); $countyName = array(); $numrow = 2; echo "<pre>"; // insert to tb participant => 1 foreach($sheet as $key => $row){ $data[] = array( 'name' => $this->split_name($row['B']), 'phone' => $row['D'], 'mobile' => $row['E'], 'institution' => $row['F'], 'departement' => $row['G'], 'address' => $row['H'], 'country' => $row['I'], );

CodeIgniter: 4.0.3 FPDF - error Class 'FPDF' not found

旧城冷巷雨未停 提交于 2021-01-29 14:18:04
问题 I am trying to generate a PDF document from CodeIgniter: 4.0.3 using fpdf library. I have copied fpdf library in app/ThirdParty folder. I have included library reference at the top of controller like this. <?php namespace App\Controllers\Purchase; namespace App\ThirdParty\fpdf; use CodeIgniter\Controller; use FPDF; I have created a class in the controller to extend FPDF to include header and footers like this. class PDF extends FPDF { function Header() { } } I generate the pdf like this. $pdf

React native Axios or fetch when i called post method (get method working fine) post parameters are getting null data on server side

≡放荡痞女 提交于 2021-01-29 09:41:09
问题 When called the post method getting null parameters on the server-side (PHP - Codeigniter). When I used JSON.stringify it is working but on the server-side, I have to handle the request with the payload ( $request_body = file_get_contents('php://input')) as of now is fine, Problem is when I am trying to upload a file (Video/ Image) , Payload won't support. So If I am using the form data it is throwing network error it means Axios did not even go to the server. I have tested the same service

How to calculate group_concat in codeigniter

人盡茶涼 提交于 2021-01-29 08:02:08
问题 I want to groupconcat product name..but it displaying undefined index product name in my view page..I don't know where i am making mistake..please help me to groupconcat product name.. controller code: $this->db->select('GROUP_CONCAT(prdtname)', false); $this->db->from('purchaseitem'); $this->db->group_by('vno'); $query1=$this->db->get()->row_array(); $data['query1']= $query1; I tried groupconcat in sql on my localhost it gives me an expected result..but i don't know where i had done mistake

dealing with concurrent & aborted uploads, codeigniter

心已入冬 提交于 2021-01-29 07:46:20
问题 Does anyone know the best way to deal with concurrent uploads and what todo if a user only partially uploads a file and then quits for some reason? (or their internet dies). Here's my controller: http://pastebin.com/wqnFAge6 And the model: http://pastebin.com/0S5ai2re the upload in the controller if($this->input->post('upload')) { $uploaded_image_ids = $this->Site_model->do_upload(); //$uploaded_image_id = $this->Site_model->get_last(); $values = array( 'image_id' => implode(",",$uploaded

how to generate a dynamic css file using php or codeigniter

给你一囗甜甜゛ 提交于 2021-01-29 07:45:58
问题 I want to develop a project with dynamic css file ,i mean i want to apply styles dynamically with out using static css file. I want to apply styles like colors, borders, width, heights etc..from one form fields and those are stored in database and i want to get values from database and apply changes dynamically in css file(styles), project css applied as dynamically.How can i write code in this scenario .css file #border { border: 30px; } #color { color: red; } like this... php form view <h1

Google Cloud Storage | PHP | Uploaded files are at 0 Bytes

只愿长相守 提交于 2021-01-29 07:31:43
问题 I am using a Codeigniter application and trying to provide access for users to upload files. the server is setup on a Google Compute Engine VM running CentOS 7 and Apache 2, I am trying to use Google Cloud Storage for user upload. Currently when I upload files only the file names are being uploaded into GCS Bucket with the file size as 0 bytes. My Frontend Code: <body> <form action="/includes/includes_gc/do_upload" class="dropzone" id="pfUploads" enctype="multipart/form-data"> </form> <script

GROUP_CONCAT in CodeIgniter

我是研究僧i 提交于 2021-01-29 07:24:31
问题 I'm just blocking to how create my group_concat with my sql request in CodeIgniter. All my queries are listed in a table, using Jtable library. All work fine, except when I try to insert GROUP_CONCAT. Here's my model page : function list_all() { $login_id = $this->session->userdata('User_id'); $this->db->select('p.project_id, p.Project, p.Description, p.Status, p.Thumbnail, t.Template'); $this->db->from('assigned_projects_ppeople a'); $this->db->where('people_id', $login_id); $this->db->join(

Codeigniter Tank_auth session not set

狂风中的少年 提交于 2021-01-29 07:03:37
问题 I have tried all the ways to set the session in the Codeigniter (3.0.6) and Tank Auth (a plug in for Login and Registration). Nothing is working for me. Here is my ci_session table data. Below is my Config file info for the session. $config['sess_driver'] = 'database'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = 'ci_session'; $config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy']

Codeigniter 4 Pagination with join tables showing error

廉价感情. 提交于 2021-01-29 06:44:34
问题 I am working on codeigniter project. I am showing news table with join left news category and paginate. When I tried the below code I get an error Call to undefined method CodeIgniter\Database\MySQLi\Builder::paginate() . How to show news data with join and pagination? $db = \Config\Database::connect(); $news_tbl = $db->table('tbl_news')->join('tbl_category', 'tbl_news.category_id = tbl_category.category_id'); $data['news_fetched'] = $news_tbl->paginate(10); $data['pager'] = $news_fetched-