<?php require ("header.php") ?>
      
                  
<?php
if (isset($_POST['profile_action'])) {
    // Sanitize and trim inputs
    $fields = [
        'sex', 'firstname', 'lastname', 'username', 'email', 'phone', 'gender', 'm_status', 'dob',
        'id_no',  'id_type', 'country', 'state', 'city', 'p_code', 'address',
        'occupation', 'company', 'ann_incom', 'acc_type', 'currency', 'tr_limit'
    ];

    $data = [];
    foreach ($fields as $field) {
        // Sanitize and trim each field
        $data[$field] = htmlspecialchars(trim($_POST[$field] ?? ''));
    }

    // Ensure the ID is set and not empty
    if (!isset($id) || empty($id)) {
        die("User ID not set or empty.");
    }

    // Debugging: Print the POST data (Remove this line when you're done debugging)
    // print_r($_POST);

    // Prepare and execute the PDO update statement
    $updateStmt = $pdo->prepare("UPDATE logins SET 
        sex = :sex,
        username = :username,
        firstname = :firstname,
        lastname = :lastname,
        email = :email,
        phone = :phone,
        gender = :gender,
        m_status = :m_status,
        dob = :dob,
        country = :country,
        state = :state,
        city = :city,
        currency = :currency,
        tr_limit = :tr_limit,
        occupation = :occupation,
        company = :company,
        ann_incom = :ann_incom,
        address = :address,
        p_code = :p_code,
        id_type = :id_type,
        id_no = :id_no,
        acc_type = :acc_type,
        verified = 1
        WHERE id = :id");

    // Add 'id' to the data array
    $data['id'] = $id;

    try {
        // Execute the prepared statement
        echo "Executing update query...";  // Debugging message, can be removed after testing
        $updateStmt->execute($data);

        // Check how many rows were affected
        $rowsAffected = $updateStmt->rowCount();
       
       if ($rowsAffected > 0) {
    // Successful update message with JS alert
    echo "<script>
        alert('Uploading Information... Please wait.');
        setTimeout(function() {
            window.location.href = 'index.php';  // Redirect to index.php after 5 seconds
        }, 5000);  // 5000ms = 5 seconds
    </script>";
}

       
       else {
            // If no rows were updated, inform the user
            echo "No rows updated. Please check your input data.";
        }
    } catch (PDOException $e) {
        // Error handling in case of failure
        echo "Error: " . $e->getMessage();
    }
}
?>

  
                     <div class="nk-content ">
        <div class="container-fluid">
            <div class="nk-content-inner">
                    <div class="nk-block-head nk-block-head-sm">
                         
 
 <div class="container-fluid py-4">
 
  <div class="row">
        <div class="col-12">
          <div class="card my-4">
            <div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
              <div class="bg-gradient-primary shadow-primary border-radius-lg pt-4 pb-3">
                <h4 class="text-white text-capitalize ps-3"><img src="icon/ibft.png" height="40" width="40" > MANAGE ACCOUNTS</h4> 
              </div>
            </div>
            <div class="card-body px-0 pb-2"> 
                		
<style>
 
.topnav {
  overflow: hidden;
  background-color: black;
}

.topnav a {
  float: left;
  color: #f2f2f2;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
  font-weight:700;
}

.topnav a:hover {
  background-color: #d13e16;
  color: white;
}

.topnav a.active {
  background-color: black;
  color: white;
}
</style>
 

<div class="topnav">
  <a class="active" href="edit_profile.php" target="_self">Edit Profile</a>
  <a href="change-password.php" target="_self">Change Password</a>
  <a href="change_photo.php" target="_self">Update Photo</a>
  <!--<a href="change_email.php" target="_self">Email</a>-->
  <a href="change-transaction-pin.php" target="_self">Security Pin</a>
</div>
                
 <div class="hk-pg-header">
<div>
<h2 class="hk-pg-title font-weight-600">Edit Account</h2>
</div>
<div class="flex-wrap mb-0 ">
</div>
</div>
          
            		    <div class="container"> 
       
   
       <form  method="post"  action="" class="form-horizontal">
       <?php if(isset($success_profile)){
    echo $success_profile;
}
?>
        
        <table width="100%" border="0" cellspacing="2" cellpadding="0" style="font-size:12px;">
           
             <tr class='rowtab'>
          <td style='padding:2px 5px; background:#014E72; color:#fff; text-align:center; font-style:italic;' colspan='2'>
          ACCOUNT DETAILS            </td>
        </tr>
           
    


        <?php
$stmt = $pdo->prepare("SELECT * FROM logins WHERE id = ?");
$stmt->execute([$id]);
$ordrow = $stmt->fetch(PDO::FETCH_ASSOC);

    echo"
       
      <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>Gendar: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'>
          
          
          <select name='sex' class='form-control' required>
<option value='".$ordrow['sex']."' selected/>";
          
                     if($ordrow['sex'] == 1) {
      echo "Male";
    }
       elseif($ordrow['sex'] == 2) {
        echo "Female";
    }
         
       echo"</option>
         <option value='1'>Male</option>
        <option value='2' >Female</option>
      </select>  
         
         
         </td>
        </tr> 
       
       
       
       
       
       
       
       
       
        
       
           
           
        
        
        
         <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>Marital Status: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'>
          
          
          <select name='m_status' class='form-control' required>
<option value='".$ordrow['m_status']."' selected/>";
          
                    if($ordrow['m_status'] == 1) {
      echo 'SINGLE';
    }
    
    elseif($ordrow['m_status'] == 2) {
      echo 'MARRIED';
    }
     elseif($ordrow['m_status'] == 3) {
      echo 'DIVORCE';
    }
    
         
       echo"</option>
         <option value='1'> Single</option>
        <option value='2' > Married</option>
         <option value='3' > Divorced</option>
      </select>  
         
         
         </td>
        </tr> 
       
       
       
       
       
       <tr class='rowtab' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab''>
          <td width='25%' style='padding:2px 5px;'>User Name :<span class='style5'>*</span></td>
          <td width='75%' style='padding:2px 5px;'>
          <input type='text' name='username' class='form-control'  size='30' value='".$ordrow['username']."' required/></td>
          </tr>
       
       
       
       
       <hr>
       
       
       
        
        <tr class='rowtab' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab''>
          <td width='25%' style='padding:2px 5px;'>First Name :<span class='style5'>*</span></td>
          <td width='75%' style='padding:2px 5px;'>
          <input type='text' name='firstname' class='form-control'  size='30' value='".$ordrow['firstname']."' required/></td>
          </tr>
          
          
           
       
       
      
       
       
        <tr class='rowtab' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab''>
          <td width='25%' style='padding:2px 5px;'>Last Name :<span class='style5'>*</span></td>
          <td width='75%' style='padding:2px 5px;'>
          <input type='text' name='lastname' class='form-control'  size='30' value='".$ordrow['lastname']."' ></td>
          </tr>
          
          

          
        <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
          <td style='padding:2px 5px;'>Account Email <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'>
          <input type='email' name='email' value='".$ordrow['email']."' class='form-control'  size='30' required/>
          </td>
        </tr>
        
        
       
        
        <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
          <td style='padding:2px 5px;'>Account Phone: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'><input class='form-control' name='phone' type='text' value='".$ordrow['phone']."' size='30' required/></td>
        </tr>
        
        




        
        
        
        
          
            <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
          <td style='padding:2px 5px;'>Date of Birth: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'><input class='form-control' name='dob' type='date'  value='".$ordrow['dob']."' size='30' required></td>
        </tr>
        
        
        
        
        
        
        
         <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>Country: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'>
          <select name='country' class='form-control' required/>
        <option selected='selected' value='".$ordrow['country']."'>".$ordrow['country']."</option>
        <option value='Afghanistan'>Afghanista</option>
        <option value='Aland Islands'>Aland Islands</option>
        <option value='Albania'>Albania</option>
        <option value='Algeria'>Algeria</option>
        <option value='American Samoa'>American Samoa</option>
        <option value='Andorra'>Andorra</option>
        <option value='Angola'>Angola</option>
        <option value='Anguilla'>Anguilla</option>
        <option value='Antarctica'>Antarctica</option>
        <option value='Antigua and Barbuda'>Antigua and Barbuda</option>
        <option value='Argentina'>Argentina</option>
        <option value='Armenia'>Armenia</option>
        <option value='Aruba'>Aruba</option>
        <option value='Australia'>Australia</option>
        <option value='Austria'>Austria</option>
        <option value='Azerbaijan'>Azerbaijan</option>
        <option value='Bahamas'>Bahamas</option>
        <option value='Bahrain'>Bahrain</option>
        <option value='Bangladesh'>Bangladesh</option>
        <option value='Barbados'>Barbados</option>
        <option value='Belarus'>Belarus</option>
        <option value='Belgium'>Belgium</option>
        <option value='Belize'>Belize</option>
        <option value='Benin'>Benin</option>
        <option value='Bermuda'>Bermuda</option>
        <option value='Bhutan'>Bhutan</option>
        <option value='Bolivia'>Bolivia</option>
        <option value='Bosnia and Herzegovina'>Bosnia and Herzegovina</option>
        <option value='Botswana'>Botswana</option>
        <option value='Bouvet Island'>Bouvet Island</option>
        <option value='Brazil'>Brazil</option>
        <option value='British Indian Ocean Territory'>British Indian Ocean Territory</option>
        <option value='British Virgin Islands'>British Virgin Islands</option>
        <option value='Brunei'>Brunei</option>
        <option value='Bulgaria'>Bulgaria</option>
        <option value='Burkina Faso'>Burkina Faso</option>
        <option value='Burundi'>Burundi</option>
        <option value='Cambodia'>Cambodia</option>
        <option value='Cameroon'>Cameroon</option>
        <option value='Canada'>Canada</option>
        <option value='Cape Verde'>Cape Verde</option>
        <option value='Cayman Islands'>Cayman Islands</option>
        <option value='Central African Republic'>Central African Republic</option>
        <option value='Chad'>Chad</option>
        <option value='Chile'>Chile</option>
        <option value='China'>China</option>
        <option value='Christmas Island'>Christmas Island</option>
        <option value='Cocos (Keeling) Islands'>Cocos (Keeling) Islands</option>
        <option value='Colombia'>Colombia</option>
        <option value='Comoros'>Comoros</option>
        <option value='Congo'>Congo</option>
        <option value='Cook Islands'>Cook Islands</option>
        <option value='Costa Rica'>Costa Rica</option>
        <option value='Croatia'>Croatia</option>
        <option value='Cuba'>Cuba</option>
        <option value='Cyprus'>Cyprus</option>
        <option value='Czech Republic'>Czech Republic</option>
        <option value='Democratic Republic of Congo'>Democratic Republic of Congo</option>
        <option value='Denmark'>Denmark</option>
        <option value='Disputed Territory'>Disputed Territory</option>
        <option value='Djibouti'>Djibouti</option>
        <option value='Dominica'>Dominica</option>
        <option value='Dominican Republic'>Dominican Republic</option>
        <option value='East Timor'>East Timor</option>
        <option value='Ecuador'>Ecuador</option>
        <option value='Egypt'>Egypt</option>
        <option value='El Salvador'>El Salvador</option>
        <option value='Equatorial Guinea'>Equatorial Guinea</option>
        <option value='Eritrea'>Eritrea</option>
        <option value='Estonia'>Estonia</option>
        <option value='Ethiopia'>Ethiopia</option>
        <option value='Falkland Islands'>Falkland Islands</option>
        <option value='Faroe Islands'>Faroe Islands</option>
        <option value='Federated States of Micronesia'>Federated States of Micronesia</option>
        <option value='Fiji'>Fiji</option>
        <option value='Finland'>Finland</option>
        <option value='France'>France</option>
        <option value='French Guyana'>French Guyana</option>
        <option value='French Polynesia'>French Polynesia</option>
        <option value='French Southern Territories'>French Southern Territories</option>
        <option value='Gabon'>Gabon</option>
        <option value='Gambia'>Gambia</option>
        <option value='Georgia'>Georgia</option>
        <option value='Germany'>Germany</option>
        <option value='Ghana'>Ghana</option>
        <option value='Gibraltar'>Gibraltar</option>
        <option value='Greece'>Greece</option>
        <option value='Greenland'>Greenland</option>
        <option value='Grenada'>Grenada</option>
        <option value='Guadeloupe'>Guadeloupe</option>
        <option value='Guam'>Guam</option>
        <option value='Guatemala'>Guatemala</option>
        <option value='Guinea'>Guinea</option>
        <option value='Guinea-Bissau'>Guinea-Bissau</option>
        <option value='Guyana'>Guyana</option>
        <option value='Haiti'>Haiti</option>
        <option value='Heard Island and Mcdonald Islands'>Heard Island and Mcdonald Islands</option>
        <option value='Honduras'>Honduras</option>
        <option value='Hong Kong'>Hong Kong</option>
        <option value='Hungary'>Hungary</option>
        <option value='Iceland'>Iceland</option>
        <option value='India'>India</option>
        <option value='Indonesia'>Indonesia</option>
        <option value='Iran'>Iran</option>
        <option value='Iraq'>Iraq</option>
        <option value='Iraq-Saudi Arabia Neutral Zone'>Iraq-Saudi Arabia Neutral Zone</option>
        <option value='Ireland'>Ireland</option>
        <option value='Israel'>Israel</option>
        <option value='Italy'>Italy</option>
        <option value='Ivory Coast'>Ivory Coast</option>
        <option value='Jamaica'>Jamaica</option>
        <option value='Japan'>Japan</option>
        <option value='Jordan'>Jordan</option>
        <option value='Kazakhstan'>Kazakhstan</option>
        <option value='Kenya'>Kenya</option>
        <option value='Kiribati'>Kiribati</option>
        <option value='Kuwait'>Kuwait</option>
        <option value='Kyrgyzstan'>Kyrgyzstan</option>
        <option value='Laos'>Laos</option>
        <option value='Latvia'>Latvia</option>
        <option value='Lebanon'>Lebanon</option>
        <option value='Lesotho'>Lesotho</option>
        <option value='Liberia'>Liberia</option>
        <option value='Libya'>Libya</option>
        <option value='Liechtenstein'>Liechtenstein</option>
        <option value='Lithuania'>Lithuania</option>
        <option value='Luxembourg'>Luxembourg</option>
        <option value='Macau'>Macau</option>
        <option value='Macedonia'>Macedonia</option>
        <option value='Madagascar'>Madagascar</option>
        <option value='Malawi'>Malawi</option>
        <option value='Malaysia'>Malaysia</option>
        <option value='Maldives'>Maldives</option>
        <option value='Mali'>Mali</option>
        <option value='Malta'>Malta</option>
        <option value='Marshall Islands'>Marshall Islands</option>
        <option value='Martinique'>Martinique</option>
        <option value='Mauritania'>Mauritania</option>
        <option value='Mauritius'>Mauritius</option>
        <option value='Mayotte'>Mayotte</option>
        <option value='Mexico'>Mexico</option>
        <option value='Moldova'>Moldova</option>
        <option value='Monaco'>Monaco</option>
        <option value='Mongolia'>Mongolia</option>
        <option value='Montenegro'>Montenegro</option>
        <option value='Montserrat'>Montserrat</option>
        <option value='Morocco'>Morocco</option>
        <option value='Mozambique'>Mozambique</option>
        <option value='Myanmar'>Myanmar</option>
        <option value='Namibia'>Namibia</option>
        <option value='Nauru'>Nauru</option>
        <option value='Nepal'>Nepal</option>
        <option value='Netherlands Antilles'>Netherlands Antilles</option>
        <option value='Netherlands'>Netherlands</option>
        <option value='New Caledonia'>New Caledonia</option>
        <option value='New Zealand'>New Zealand</option>
        <option value='Nicaragua'>Nicaragua</option>
        <option value='Niger'>Niger</option>
        <option value='Nigeria'>Nigeria</option>
        <option value='Niue'>Niue</option>
        <option value='Norfolk Island'>Norfolk Island</option>
        <option value='North Korea'>North Korea</option>
        <option value='Northern Mariana Islands'>Northern Mariana Islands</option>
        <option value='Norway'>Norway</option>
        <option value='Oman'>Oman</option>
        <option value='Pakistan'>Pakistan</option>
        <option value='Palau'>Palau</option>
        <option value='Palestinian Territories'>Palestinian Territories</option>
        <option value='Panama'>Panama</option>
        <option value='Papua New Guinea'>Papua New Guinea</option>
        <option value='Paraguay'>Paraguay</option>
        <option value='Peru'>Peru</option>
        <option value='Philippines'>Philippines</option>
        <option value='Pitcairn Islands'>Pitcairn Islands</option>
        <option value='Poland'>Poland</option>
        <option value='Portugal'>Portugal</option>
        <option value='Puerto Rico'>Puerto Rico</option>
        <option value='Qatar'>Qatar</option>
        <option value='Reunion'>Reunion</option>
        <option value='Romania'>Romania</option>
        <option value='Russia'>Russia</option>
        <option value='Rwanda'>Rwanda</option>
        <option value='Saint Helena and Dependencies'>Saint Helena and Dependencies</option>
        <option value='Saint Kitts and Nevis'>Saint Kitts and Nevis</option>
        <option value='Saint Lucia'>Saint Lucia</option>
        <option value='Saint Pierre and Miquelon'>Saint Pierre and Miquelon</option>
        <option value='Saint Vincent and the Grenadines'>Saint Vincent and the Grenadines</option>
        <option value='Samoa'>Samoa</option>
        <option value='San Marino'>San Marino</option>
        <option value='Sao Tome and Principe'>Sao Tome and Principe</option>
        <option value='Saudi Arabia'>Saudi Arabia</option>
        <option value='Senegal'>Senegal</option>
        <option value='Serbia'>Serbia</option>
        <option value='Seychelles'>Seychelles</option>
        <option value='Sierra Leone'>Sierra Leone</option>
        <option value='Singapore'>Singapore</option>
        <option value='Slovakia'>Slovakia</option>
        <option value='Slovenia'>Slovenia</option>
        <option value='Solomon Islands'>Solomon Islands</option>
        <option value='Somalia'>Somalia</option>
        <option value='South Africa'>South Africa</option>
        <option value='South Georgia and South Sandwich Islands'>South Georgia and South Sandwich Islands </option>
        <option value='South Korea'>South Korea</option>
        <option value='Spain'>Spain </option>
        <option value='Spratly Islands'>Spratly Islands</option>
        <option value='Sri Lanka'>Sri Lanka</option>
        <option value='Sudan'>Sudan</option>
        <option value='Suriname'>Suriname</option>
        <option value='Svalbard and Jan Mayen'>Svalbard and Jan Mayen</option>
        <option value='Swaziland'>Swaziland</option>
        <option value='Sweden'>Sweden</option>
        <option value='Switzerland'>Switzerland</option>
        <option value='Syria'>Syria</option>
        <option value='Taiwan'>Taiwan</option>
        <option value='Tajikistan'>Tajikistan</option>
        <option value='Tanzania'>Tanzania</option>
        <option value='Thailand'>Thailand</option>
        <option value='Togo'>Togo</option>
        <option value='Tokelau'>Tokelau</option>
        <option value='Tonga'>Tonga</option>
        <option value='Trinidad and Tobago'>Trinidad and Tobago</option>
        <option value='Tunisia'>Tunisia</option>
        <option value='Turkey'>Turkey</option>
        <option value='Turkmenistan'>Turkmenistan</option>
        <option value='Turks And Caicos Islands'>Turks And Caicos Islands</option>
        <option value='Tuvalu'>Tuvalu</option>
        <option value='US Virgin Islands'>US Virgin Islands</option>
        <option value='Uganda'>Uganda</option>
        <option value='Ukraine'>Ukraine</option>
        <option value='United Arab Emirates'>United Arab Emirates</option>
        <option value='United Kingdom'>United Kingdom</option>
        <option value='United States Minor Outlying Islands'>United States Minor Outlying Islands</option>
        <option value='United States'>United States</option>
        <option value='Uruguay'>Uruguay</option>
        <option value='Uzbekistan'>Uzbekistan</option>
        <option value='Vanuatu'>Vanuatu</option>
        <option value='Vatican City'>Vatican City</option>
        <option value='Venezuela'>Venezuela</option>
        <option value='Vietnam'>Vietnam</option>
        <option value='Wallis and Futuna'>Wallis and Futuna</option>
        <option value='Western Sahara'>Western Sahara</option>
        <option value='Yemen'>Yemen</option>
        <option value='Zambia'>Zambia</option>
        <option value='Zimbabwe'>Zimbabwe</option>
      </select>
          </td>
        </tr>
        
        
        
        
        
        
         <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>Address: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'><input class='form-control' name='address' type='text'  value='".$ordrow['address']."' size='30' required/></td>
        </tr>
        
        
        
         <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>State: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'><input class='form-control' name='state' type='text'  value='".$ordrow['state']."' size='30' required/></td>
        </tr>
        
        
         <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>City: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'><input class='form-control' name='city' type='text'  value='".$ordrow['city']."' size='30' required/></td>
        </tr>
        
        
        
        
        
        
        
        
        
        
        <hr>
        
         <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>Occupation: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'><input class='form-control' name='occupation' type='text'  value='".$ordrow['occupation']."' size='30' required/></td>
        </tr>
        
        
        
        
         <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>Company Name: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'><input class='form-control' name='company' type='text'  value='".$ordrow['company']."' size='30' required/></td>
        </tr>
        
        
        
       <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>Annual Imcome: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'><input class='form-control' name='ann_incom' type='text'  value='".$ordrow['ann_incom']."' size='30' required/></td>
        </tr>  
        
        
        
        
        
         <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>Transfer Limit: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'><input class='form-control' name='tr_limit' type='text'  value='".$ordrow['tr_limit']."' size='30' required/></td>
        </tr>
        
        
        
        
        
             
   <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>Currency: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'>
          
          
          <select name='currency' class='form-control' required>
<option value='".$ordrow['currency']."' selected/>";
          
          
          if($ordrow['currency'] == 1) {
      echo 'USD';
    }
 
 elseif($ordrow['currency'] == 2) {
      echo 'GBP';
    }
    
    elseif($ordrow['currency'] == 3) {
      echo 'EUR';
    }
     elseif($ordrow['currency'] == 4) {
      echo 'AUD';
    }
     elseif($ordrow['currency'] == 5) {
      echo 'CAD';
    }
     elseif($ordrow['currency'] == 6) {
      echo 'CNY';
    }
     elseif($ordrow['currency'] == 7) {
      echo 'ZAR';
    }
    //  elseif($numrow['currency'] == 8) {
    //   echo 'NGN';
    // }
    
     elseif($ordrow['currency'] == 9) {
      echo 'GHS';
    }
      
     elseif($ordrow['currency'] == 10) {
      echo 'JPY';
    }
    
    
      elseif($ordrow['currency'] == 11) {
      echo 'KRW';
    }
      elseif($ordrow['currency'] == 12) {
      echo 'TWD';
    }
      elseif($ordrow['currency'] == 13) {
      echo 'THB';
    }
      elseif($ordrow['currency'] == 14) {
      echo 'MYR';
    }
      elseif($ordrow['currency'] == 15) {
      echo 'BRL';
    }
      elseif($ordrow['currency'] == 16) {
      echo 'ARS';
    }
      elseif($ordrow['currency'] == 17) {
      echo 'PHP';
    }
      elseif($ordrow['currency'] == 18) {
      echo 'AED';
    }
    
         
         
       echo"</option>
     <option value='1'>USD</option>
         <option value='2'>GBP</option>
         <option value='3'>EUR</option>
         <option value='4'>AUD</option>
         <option value='5'>CAD</option>
         <option value='6'>CNY</option>
         <option value='7'>ZAR</option>

           <option value='9'>GHS</option>
           <option value='10'>JPY</option>
           
           <option value='11'>KRW</option>
           <option value='12'>TWD</option>
           <option value='13'>THB</option>
           <option value='14'>MYR</option>
           <option value='15'>BRL</option>
           <option value='16'>ARS</option>
           <option value='17'>PHP</option>
           <option value='18'>AED</option>
      </select>  
         
         
         </td>
        </tr>      
        
        
        
        
        
        
        
   <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>Account Type: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'>
          
          
          <select name='acc_type' class='form-control' required>
<option value='".$ordrow['acc_type']."' selected/>";
          
                    if($ordrow['acc_type'] == 1) {
      echo "Savings Account.";
    }
       elseif($ordrow['acc_type'] == 2) {
        echo "Current Account";
    }
    
     elseif($ordrow['acc_type'] == 3) {
        echo "MPower Business Account";
    }
    
     elseif($ordrow['acc_type'] == 4) {
        echo "Checking account";
    }
    
     elseif($ordrow['acc_type'] == 5) {
        echo "Money market accounts";
    }
    
    
     elseif($ordrow['acc_type'] == 6) {
        echo "Certificates of deposit";
    }
    
    
     elseif($ordrow['acc_type'] == 7) {
        echo "Brokerage accounts";
    }
    
    
     elseif($ordrow['acc_type'] == 8) {
        echo "Individual retirement accounts";
    }
  
      
    
         
         
       echo"</option>
         <option value='1'>Savings Account</option> 
   
     <option value='4'>Checking account</option> 
      </select>  
         
         
         </td>
        </tr>      
        
        
        
        
     
         <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>ID No: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'><input class='form-control' name='id_no' type='text'  value='".$ordrow['id_no']."' size='30' required/></td>
        </tr>
           
        
        
        
        
        
             
   <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>Means of Identification: <span class='style5'>*</span></td>
          <td style='padding:2px 5px;'>
          
          
          <select name='id_type' class='form-control' required>
<option value='".$ordrow['id_type']."' selected/>";
          
                   if($ordrow['id_type'] == 1) {
      echo 'International Passport';
    }
    
    elseif($ordrow['id_type'] == 2) {
      echo 'Drivers Licence';
    }
     elseif($ordrow['id_type'] == 3) {
      echo 'National ID Card';
    }
     elseif($ordrow['id_type'] == 4) {
      echo 'Others';
    }
      
    
         
         
       echo"</option>
      <option value='1' >International Passport</option>
<option value='2' >Drivers Licence</option>
<option value='3'  >National ID Card</option>
<option value='4' >Others</option>
      </select>  
         
         
         </td>
        </tr>      
        
        
        
     
        
        
       
       
        ";
    
   
   
   

?>

       
       
       
       
       

      <?php
// Assume $pdo is your valid PDO connection

$stmt = $pdo->prepare("SELECT * FROM settings ORDER BY id DESC");
$stmt->execute();
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);

foreach ($rows as $row) {
    echo "
    <input type='hidden' class='form-control' name='cname' id='details' value='" . htmlspecialchars($row['domain_name']) . "'>
    <input type='hidden' class='form-control' name='cemail' id='details' value='" . htmlspecialchars($row['email2']) . "'>
    <input type='hidden' class='form-control' name='cphone' id='details' value='" . htmlspecialchars($row['phone']) . "'>
    <input type='hidden' class='form-control' name='caddress' id='details' value='" . htmlspecialchars($row['address']) . "'>
    ";
}
?>

      
      
          <tr class='rowtab2' onMouseOver='this.className='normalForm'' onMouseOut='this.className='rowtab2''>
        <td style='padding:2px 5px;'>
       
        <span class='style5'>*</span></td>
        
        
          <td style='padding:2px 5px;'>
          <button type="submit" name="profile_action" value="Change" class="btn btn-primary" >Update Details</button>
          </td>
        </tr>
        
        
        
        
          </table>
                    </form> <div class="col-lg-6">







 </div>
                  
                  
                  
                  </div>       </div>       </div>       </div>       </div>       </div>         
          



<?php require ("footer.php")?>