Update has been successful. Setting has been successfully updated!
A PHP Error was encountered

Severity: Warning

Message: Invalid argument supplied for foreach()

Filename: views/settings.php

Line Number: 68

Backtrace:

File: C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\companygiondaci\application\views\settings.php
Line: 68
Function: _error_handler

File: C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\companygiondaci\application\controllers\Cpages.php
Line: 683
Function: view

File: C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\companygiondaci\index.php
Line: 315
Function: require_once

Line 68: <?php foreach($setting as $setting_item): ?>

views/settings.php

<?php 

                        if($setting === TRUE)

                        {

                            echo "Update has been successful.";

                        }

                        ?>

                        <?php echo $success_message; ?>
                        <?php echo validation_errors(); ?>

                        <?php echo form_open('Cpages/updatesettings'); ?>                       

                        <table border="0" style="width: 100%; height: 90px;">

                        <?php //foreach($query->result() as $setting_item): ?>
                        <?php foreach($setting as $setting_item): ?>

                            <tr>
                                <td><b>Contact Information</b></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td>Email</td>
                                <td><input type="text" name="email" value="<?php echo $setting_item->email; ?>"></td>
                            </td>   
                            <tr>
                                <td>Site Name</td>
                                <td><input type="text" name="sitename" value="<?php echo $setting_item->site_name; ?>"></td>
                            </td>
                            <tr>
                                <td></td>
                                <td><br></td>                               
                            </tr>   
                            <tr>
                                <td><b>Site Information</b></td>
                                <td></td>
                            </td>
                            <tr>
                                <td>Meta Title</td>
                                <td><input type="text" name="title" value="<?php echo $setting_item->meta_title; ?>"></td>
                            </td>
                            <tr>
                                <td>Meta Keyword</td>
                                <td><input type="text" name="keyword" value="<?php echo $setting_item->meta_keyword; ?>"></td>
                            </td>
                            <tr>
                                <td>Meta Description</td>
                                <td><input type="text" name="description" value="<?php echo $setting_item->meta_description; ?>"></td>
                            </td>
                            <tr>
                                <td></td>
                                <td><br></td>                               
                            </tr>
                            <tr>
                                <td><b>Social Media Information</b></td>
                                <td></td>
                            </td>
                            <tr>
                                <td>Facebook</td>
                                <td><input type="text" name="facebook" value="<?php echo $setting_item->facebook; ?>"></td>
                            </td>
                            <tr>
                                <td>Twitter</td>
                                <td><input type="text" name="twitter" value="<?php echo $setting_item->twitter; ?>"></td>
                            </td>
                            <tr>
                                <td>RSS</td>
                                <td><input type="text" name="rss" value="<?php echo $setting_item->rss; ?>"></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td><br></td>                               
                            </tr>   
                            <tr>
                                <td></td>
                                <td><input type="submit" name="submit" class="edit" value="Submit"></td>
                            </tr>                   

                        <?php endforeach ?>

Can you show the method controller?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.