PHP warning

Invalid argument supplied for foreach()

/home/suryasukses/public_html/protected/views/home/product_range_detail.php(50)

38       </div>
39       <div class="col-md-45 rights_cont_def">
40 
41         <h6><?php echo ucwords($n_parent['name_category']) ?></h6>
42         <div class="clear clearfix py-1"></div>
43         <h3><?php echo ucwords($n_child['names']) ?></h3>
44 
45         <div class="row feature-data">
46           <div class="col-md-60">
47             <div class="featured_car_detail">
48                 <div id="carouselEx_gallery" class="carousel slide" data-ride="carousel">
49                   <ol class="carousel-indicators">
50                     <?php foreach ($n_child['picture'] as $key => $value): ?>
51                     <li data-target="#carouselEx_gallery" data-slide-to="<?php echo $key ?>" <?php if ($key == 0): ?>class="active"<?php endif ?>></li>
52                     <?php endforeach ?>
53                   </ol>
54                   <div class="carousel-inner">
55                     <?php foreach ($n_child['picture'] as $key => $value): ?>
56                     <div class="carousel-item <?php if ($key == 0): ?>active<?php endif ?>">
57                       <img class="img img-fluid w-100" src="<?php echo $this->assetBaseurl.'../../images/products/'; ?><?php echo $value ?>" alt="<?php echo $_GET['slug'] ?>"> 
58                     </div>
59                     <?php endforeach ?>
60                   </div>
61                 </div>
62             </div>

Stack Trace

#4
+
 /home/suryasukses/public_html/protected/controllers/HomeController.php(921): CController->render("product_range_detail", array("product_resource" => array(array("name_category" => "packaging", "picture" => array("cover-bottle.jpg", "cover-closures.jpg", "cover-drinking-cups.jpg", "cover-containers.jpg", ...), "desc" => "", "lists" => array(array("names" => "preform", "picture" => array("preform001.jpg", "preform002.jpg"), "info" => "<p>Our PET preform infrastructure and machineries are one of the..."), array("names" => "bottles", "picture" => array("bottle001.jpg", "bottle002.jpg"), "info" => "<p>Surya Sukses Group offers high quality bottles made from Inje..."), array("names" => "closures", "picture" => array("closures001.jpg"), "info" => "<p>Surya Sukses Group produce approximately 25% of all bottle cl..."), array("names" => "drinking cups", "picture" => array("drinking-cups001.jpg", "drinking-cups002.jpg"), "info" => "<p>At Surya Sukses Group, we produce any kind and variety of cup..."), ...)), array("name_category" => "specialty nonwoven", "picture" => array("cover-specialty.jpg"), "desc" => "<p>Our nonwoven fabric solutions are produced on unique and worl...", "lists" => array(array("names" => "spunbond polypropylene", "picture" => array("spubond-polypropylene.jpg"), "info" => "<p>Surya Sukses Group is catering the needs of economic yet dura..."), array("names" => "meltblown", "picture" => array("meltblown-001.jpg", "meltblown-002.jpg"), "info" => "<p>Our meltblown nonwoven products are formed from micro fibers ..."))), array("name_category" => "Housewares", "picture" => array("cover-bathroom.jpg", "cover-cleaningware.jpg", "cover-garden.jpg", "cover-kitchenware.jpg", ...), "desc" => "<p>Surya Sukses Group started its industrial group from a plasti...", "lists" => array(array("names" => "Storage", "picture" => array("3.jpg"), "info" => "<p>We present a variety of plastic products for smart and ergono..."), array("names" => "Sealware", "picture" => array("sealware001.jpg", "sealware002.jpg"), "info" => "<p>With Surya Sukses Group`s sophisticated and modern production..."), array("names" => "Kitchen", "picture" => array("10.jpg"), "info" => "<p>A variety of kitchen utensils and tableware are presented by ..."), array("names" => "Containers", "picture" => array("containers001.jpg", "containers002.jpg"), "info" => "<p>We manufacture varieties of plastic containers for the usage ..."), ...)), array("name_category" => "roofing", "picture" => array("cover-roofing-suryasukses.jpg"), "desc" => "", "lists" => array(array("names" => "UPVC", "picture" => array("twin-wall-001.jpg", "twin-wall-002.jpg", "twin-wall-003.jpg"), "info" => "<p>Amari UPVC roofing system is offered as part of the company`s...")))), "n_parent" => null, "n_child" => null))
916         $n_child = $data[$s_parent]['lists'][$s_ids];
917 
918         $this->render('product_range_detail', array(
919             'product_resource'=>$data,
920             'n_parent'=>$n_parent,
921             'n_child'=>$n_child,
922         ));
923     }
924 
925     public function actionMarket_landing()
926     {
#12
+
 /home/suryasukses/public_html/index.php(36): CApplication->run()
31 // specify how many levels of call stack should be shown in each log message
32 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
33 error_reporting(E_ALL ^ E_NOTICE);
34 date_default_timezone_set('Asia/Jakarta');
35 require_once($yii);
36 Yii::createWebApplication($config)->run();
37 
38 $end_timeeeee = microtime(TRUE);
39 
40 // echo $end_timeeeee - $start_timeeeee;
41 // echo "<br>";
2021-01-26 19:54:22 Apache Yii Framework/1.1.12