Plugin Directory

Changeset 2042807


Ignore:
Timestamp:
03/02/2019 01:23:10 PM (7 years ago)
Author:
codecompiled
Message:

fix: logic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-settings/trunk/wp-settings.php

    r2042805 r2042807  
    1313/*ceating tabs*/
    1414function ilc_admin_tabs( $current = '00' ) {
    15     $tabs = array( 'homepage' => 'Home Settings', 'databse' => 'Database Settings');
     15    $tabs = array( 'homepage' => 'Home Settings', 'databse' => 'Databse');
    1616    echo '<div id="tabs" class="icon32"><br></div>';
    1717    echo '<h2 class="nav-tab-wrapper">';
     
    2525//ilc_admin_tabs();
    2626/*ceating tabs*/
     27
     28
    2729add_action('admin_menu', 'wpsettings_setupOptionsMenu');
     30 
     31
     32 
     33 
    2834// action function for above hook
    2935function wpsettings_setupOptionsMenu() {
     
    3137    add_menu_page("WP Settings","WP Settings","install_plugins","wp-settings", 'wpsettings_DisplaySetingsPage');
    3238}
     39
    3340function wpsettings_load_scripts_styles() {
    3441    wp_enqueue_script( "wp-settings-script", plugin_dir_url( __FILE__ ) . '/js/wp-settings-script.js' );
     
    201208//main method to retreive wordpress information
    202209function wpsettings_GetWPInfo() {
    203    
    204     if(isset($_POST["name"]))
    205 {
    206 
    207 
    208     echo $_POST["name"];
    209 }
    210 
     210
     211$tab='';
    211212//echo 'in wpsettings_GetWPInfo';
     213if(isset($_GET['tab']))
    212214$tab=$_GET['tab'] ;
    213 $regstration = $_GET['registration'];
     215
     216//$regstration = $_GET['registration'];
    214217
    215218//echo $tab;
    216219//check which tab to display
    217220if($tab!='')
    218  
     221{
    219222   echo '<table class="form-table">';
    220223   switch ( $tab ){
     
    239242         <?php
    240243      break;
    241       default:
    242           getHomePageContent(); ?>
    243          
     244      case 'footer' :
     245         ?>
    244246       
    245247         <?php
     
    253255   echo '</table>';
    254256}
     257}
    255258//check which tab to display
    256259
     
    280283     }?>   
    281284<tr>
    282 <td  colspan="2">
    283 Download sql script,for creating and inserting values in tables.
     285<td>
     286Download database script
    284287<input type="submit" value="Download" name="submit_btn">
    285288</td>
     
    348351        for ($i = 0; $i < $num_fields; $i++)
    349352        {
    350             while($row =  mysqli_fetch_row($result))
     353            while($row =  mysqli_fetch_row($mysqli ,$result))
    351354            {
    352                 echo 'insert script';
    353355                $return.= 'INSERT INTO '.$table.' VALUES(';
    354356                for($j=0; $j < $num_fields; $j++)
     
    365367        }
    366368       
    367       ob_clean();
    368     header("Content-type: application/text");
    369     header("Content-Disposition: attachment; filename=dbBackup.sql");
    370     echo $return;
     369     ob_clean();
     370   header("Content-type: application/text");
     371   header("Content-Disposition: attachment; filename=dbBackup.txt");
     372echo $return;
    371373    exit();
    372374}
     
    495497        </tr>
    496498    <?php       
    497          
    498499     }?>   
    499500</table>
     
    506507<th colspan="2">
    507508Server Details
    508 </td>
     509</th>
    509510</tr>
    510511<?php foreach($phpdetails as $sqlKey=>$sqlValue) { ?>
     
    527528<th colspan="2">
    528529Plugin Details
    529 </td>
     530</th>
    530531</tr>
    531532<?php foreach($plugindetails as $sqlKey=>$sqlValue) { ?>
     
    539540        </tr>
    540541    <?php       
    541          
    542      } ?>   
     542     } ?></table>
    543543<!-- add new section here-->
    544 
    545 
    546544    <?php }?>
    547  
    548 
    549 </table>
    550545<!-- SQL DETAILS ENDS-->
    551  
    552 <?php
    553      } ?>   
    554 </table>
    555 
    556 
    557 <?php function wpsettings_DisplaySetingsPage() {
     546 <?php } function wpsettings_DisplaySetingsPage() {
    558547    include(plugin_dir_path( __FILE__ ).'/wp-settings-options.php'); 
    559548} ?>
Note: See TracChangeset for help on using the changeset viewer.