Category : codeigniter

There a few schools under HQ and same things goes to franchise. I want to create a dropdown list when I click "Centre" to create new data, it will also create a new data for the all schools who have been group by centre Here is my controller $this->centre= $this->db->get_where(‘schools’, array(‘group_by’=>’centre’))->result(); And this is views ..

Read more

$user_access =’example’; $user_key = ‘examplekey’; $payload = json_encode($arr); $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,’example.com/api/users/2′); curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array(‘Content-Type: application/json’,’Content-Length: ‘ . strlen($payload))); curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, ‘PUT’); curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $payload ); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_USERPWD, $user_access . ":" . $user_key); if (curl_exec($curl_handle) === FALSE) { die("Curl Failed: " . curl_error($curl_handle)); } else { return curl_exec($curl_handle); }; When I remove the curl_setopt($curl_handle, ..

Read more

<script type="text/javascript"> window.NREUM||(NREUM={}),__nr_require=function(e,n,t){function r(t){if(!n[t]){var o=n[t]={exports:{}};e[t][0].call(o.exports,function(n){var o=e[t][1][n];return r(o||n)},o,o.exports)}return n[t].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<t.length;o++)r(t[o]);return r}({1:[function(e,n,t){function r(){}function o(e,n,t){return function(){return i(e,[c.now()].concat(u(arguments)),n?null:this,t),n?void 0:this}}var i=e("handle"),a=e(2),u=e(3),f=e("ee").get("tracer"),c=e("loader"),s=NREUM;"undefined"==typeof window.newrelic&&(newrelic=s);var p=["setPageViewName","setCustomAttribute","setErrorHandler","finished","addToTrace","inlineHit","addRelease"],d="api-",l=d+"ixn-";a(p,function(e,n){s[n]=o(d+n,!0,"api")}),s.addPageAction=o(d+"addPageAction",!0),s.setCurrentRouteName=o(d+"routeName",!0),n.exports=newrelic,s.interaction=function(){return(new r).get()};var m=r.prototype={createTracer:function(e,n){var t={},r=this,o="function"==typeof n;return i(l+"tracer",[c.now(),e,t],r),function(){if(f.emit((o?"":"no-")+"fn-start",[c.now(),r,o],t),o)try{return n.apply(this,arguments)}finally{f.emit("fn-end",[c.now()],t)}}}};a("setName,setAttribute,save,ignore,onEnd,getContext,end,get".split(","),function(e,n){m[n]=o(l+n)}),newrelic.noticeError=function(e){"string"==typeof e&&(e=new Error(e)),i("err",[e,c.now()])}},{}],2:[function(e,n,t){function r(e,n){var t=[],r="",i=0;for(r in e)o.call(e,r)&&(t[i]=n(r,e[r]),i+=1);return t}var o=Object.prototype.hasOwnProperty;n.exports=r},{}],3:[function(e,n,t){function r(e,n,t){n||(n=0),"undefined"==typeof t&&(t=e?e.length:0);for(var r=-1,o=t-n||0,i=Array(o<0?0:o);++r<o;)i[r]=e[n+r];return i}n.exports=r},{}],4:[function(e,n,t){n.exports={exists:"undefined"!=typeof window.performance&&window.performance.timing&&"undefined"!=typeof window.performance.timing.navigationStart}},{}],ee:[function(e,n,t){function r(){}function o(e){function n(e){return e&&e instanceof r?e:e?f(e,u,i):i()}function t(t,r,o,i){if(!d.aborted||i){e&&e(t,r,o);for(var a=n(o),u=m(t),f=u.length,c=0;c<f;c++)u[c].apply(a,r);var p=s[y[t]];return p&&p.push([b,t,r,a]),a}}function l(e,n){v[e]=m(e).concat(n)}function m(e){return v[e]||[]}function w(e){return p[e]=p[e]||o(t)}function ..

Read more

I am using DOMPDF to generate PDF and I want to upload that pdf to s3 when it is generated by DOMPDF here is my code which i uses for upload file on S3 but it did not worked $options = new Options(); $options->set(‘isHtml5ParserEnabled’, true); $options->set(‘isRemoteEnabled’, true); $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->set_paper($paper, $orientation); $dompdf->render(); ..

Read more

database table_img for better understanding Pardon me for weak English writing my sql query that i am getting value,low_value,high_value and limit_exceded_. issue is in limit_exceded to not get correct values, it shows all 0. SELECT `myvalues`.`value`, `sub_types`.`low_value`, `sub_types`.`high_value`, (case when myvalues.value > sub_types.low_value and myvalues.value < sub_types.high_value then 1 else 0 end) as limit_exceded FROM ..

Read more

I have to display those table columns(racipe:table) which is linked to parent table(product). this is my code below. this function is in product model function get_product_by_url($url_slug_product) { $this->db->select(‘recipe_title,recipe_image,category_name,product_name, url_slug_product, product_image, url_slug, product_subname’); $this->db->join(‘category’,’product_category_id = category_id’,’left’); $this->db->join(‘recipe’,’product_id = recipe_product_id’,’left’); $query = $this->db->get_where(‘product’, array(‘url_slug_product’ => $url_slug_product), 1); return $query; } function get_recipes(){ $this->db->select(‘recipe_id,recipe_title,recipe_image,product_id,product_name’); $this->db->from(‘recipe’); $this->db->join(‘category’,’recipe_category_id = category_id’,’left’); ..

Read more