Apple MGXC2HN/A 15-inch Laptop (Core i7/16GB/512GB/Mac OS X Mavericks/NVIDIA GeForce GT 750M 2GB DDR5 Graphics/without Laptop Bag)
<?php
/*Template Name:User profile
*/
get_header(); ?>
<div class="c_right">
<?php
global $current_user , $woocommerce;
get_currentuserinfo();
// echo "<pre>";
//print_r($current_user);
//echo "</pre>";
$userid=$current_user->data->ID;
$arydata=array('first_name','last_name','billing_company','billing_address_1','billing_address_2'
,'billing_city','billing_postcode','billing_state','billing_phone','shipping_first_name','shipping_last_name','shipping_company','shipping_address_1','shipping_address_2','shipping_city'
,'shipping_postcode','shipping_state');
$field=array('First Name','Last Name','Company','Address 1','Address 2','City', 'Postcode','State','Phone','First Name','Last Name','Company','Address 1','Address 2','City','Postcode','State');
$cunt=count($arydata);
$cunt=count($field);
$cunt=0;
if(isset($_POST['update']))
{
$useremail=$_REQUEST['useremail'];
$password1=$_REQUEST['Password'];
$password=md5($password1);
$taxid=$_REQUEST['taxid'];
$user_id=$_REQUEST['ide'];
$username=$_REQUEST['username'];
$first_name=$_REQUEST['first_name'];
$last_name=$_REQUEST['last_name'];
$nickname=$_REQUEST['nickname'];
$billing_company=$_REQUEST['billing_company'];
$billing_address_1=$_REQUEST['billing_address_1'];
$billing_address_2=$_REQUEST['billing_address_2'];
$billing_city=$_REQUEST['billing_city'];
$billing_postcode=$_REQUEST['billing_postcode'];
$billing_country=$_REQUEST['billing_country'];
$billing_state=$_REQUEST['billing_state'];
$billing_email=$useremail;
$billing_phone=$_REQUEST['billing_phone'];
$billing_taxid=$taxid;
$shipping_first_name=$_REQUEST['shipping_first_name'];
$shipping_last_name=$_REQUEST['shipping_last_name'];
$shipping_company=$_REQUEST['shipping_company'];
$shipping_address_1=$_REQUEST['shipping_address_1'];
$shipping_address_2=$_REQUEST['shipping_address_2'];
$shipping_city=$_REQUEST['shipping_city'];
$shipping_postcode=$_REQUEST['shipping_postcode'];
$shipping_taxid=$taxid;
$shipping_country=$_REQUEST['shipping_country'];
$shipping_state=$_REQUEST['shipping_state'];
if($password1=="")
{
$update1="update wp_users set user_email='$useremail' where ID='$user_id'";
$update=mysql_query($update1);
update_user_meta($user_id,'billing_first_name',$first_name);
update_user_meta($user_id,'billing_last_name',$last_name);
update_user_meta($user_id,'nickname',$nickname);
update_user_meta($user_id,'billing_company',$billing_company);
update_user_meta($user_id,'billing_address_1',$billing_address_1);
update_user_meta($user_id,'billing_address_2',$billing_address_2);
update_user_meta($user_id,'billing_city',$billing_city);
update_user_meta($user_id,'billing_postcode',$billing_postcode);
update_user_meta($user_id,'billing_country',$billing_country);
update_user_meta($user_id,'billing_state',$billing_state);
update_user_meta($user_id,'billing_email',$billing_email);
update_user_meta($user_id,'billing_phone',$billing_phone);
update_user_meta($user_id,'billing_taxid',$billing_taxid);
update_user_meta($user_id,'shipping_first_name',$shipping_first_name);
update_user_meta($user_id,'shipping_last_name',$shipping_last_name);
update_user_meta($user_id,'shipping_company',$shipping_company);
update_user_meta($user_id,'shipping_address_1',$shipping_address_1);
update_user_meta($user_id,'shipping_address_2',$shipping_address_2);
update_user_meta($user_id,'shipping_city',$shipping_city);
update_user_meta($user_id,'shipping_postcode',$shipping_postcode);
update_user_meta($user_id,'shipping_taxid',$shipping_taxid);
update_user_meta($user_id,'shipping_country',$shipping_country);
update_user_meta($user_id,'shipping_state',$shipping_state);
update_user_meta($user_id,'taxid',$taxid);
}
else
{
$update1="update wp_users set user_email='$useremail' , user_pass='$password' where ID='$user_id'";
$update=mysql_query($update1);
update_user_meta($user_id,'billing_first_name',$first_name);
update_user_meta($user_id,'billing_last_name',$last_name);
update_user_meta($user_id,'nickname',$nickname);
update_user_meta($user_id,'billing_company',$billing_company);
update_user_meta($user_id,'billing_address_1',$billing_address_1);
update_user_meta($user_id,'billing_address_2',$billing_address_2);
update_user_meta($user_id,'billing_city',$billing_city);
update_user_meta($user_id,'billing_postcode',$billing_postcode);
update_user_meta($user_id,'billing_country',$billing_country);
update_user_meta($user_id,'billing_state',$billing_state);
update_user_meta($user_id,'billing_email',$billing_email);
update_user_meta($user_id,'billing_phone',$billing_phone);
update_user_meta($user_id,'taxid',$taxid);
update_user_meta($user_id,'shipping_first_name',$shipping_first_name);
update_user_meta($user_id,'shipping_last_name',$shipping_last_name);
update_user_meta($user_id,'shipping_company',$shipping_company);
update_user_meta($user_id,'shipping_address_1',$shipping_address_1);
update_user_meta($user_id,'shipping_address_2',$shipping_address_2);
update_user_meta($user_id,'shipping_city',$shipping_city);
update_user_meta($user_id,'shipping_postcode',$shipping_postcode);
update_user_meta($user_id,'shipping_taxid',$shipping_taxid);
update_user_meta($user_id,'shipping_country',$shipping_country);
update_user_meta($user_id,'shipping_state',$shipping_state);
}if($update)
{
echo "<p style='margin-left:200px;color:green;'>Info Updated</p>";
}
}
//echo $dtl2="select * from wp_usermeta where user_id=$userid";
// print_r($arydata);
/*while($cunt<14)
{
$key=$arydata[$cunt];
$dtl=mysql_query("select * from wp_usermeta where user_id=$userid and meta_key='$key'");
$dtl1=mysql_fetch_assoc($dtl);
echo $dtl1['meta_value']."<br/>";
$cunt++;
}*/
//echo "<pre>";
//print_r($dtl1);
//echo "</pre>";
global $current_user;
get_currentuserinfo();
?>
<script>
function validateForm()
{
var x=document.forms["frm1"]["useremail"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
{
alert("Not a valid e-mail address");
return false;
}
var x=document.forms["frm1"]["taxid"].value;
if (x==null || x=="")
{
alert("TaxId must be filled out");
return false;
}
}
</script>
<!--background:#E9E9E9; -->
<!--div style="float: right;
width: 730px;padding: 4px 0 5px 10px;font-family: Verdana;color: black;font-size: 12px;margin-top: 15px;height:auto;"-->
<div class="register1">
<form name="frm1" method="post" action="" onsubmit="return validateForm()">
<input type="hidden" id="hdnSubmit_frm" name="hdnSubmit_frm" value="insert" />
<table style="width:100% !important">
<tr style="background:#E9E9E9;">
<td colspan="2"><h2 style="padding-left: 10px;">User Profile<h2></td></tr>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">Name</td>
<td>
<input name="username" id="username" type="text" value="<?php echo $current_user->user_login ;?>" class="billing_fild" readonly="readonly"><i style="color:red">unable to change username</i></td>
</tr>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">Email Address</td>
<td><input name="useremail" id="useremail" type="text" value="<?php echo $current_user->user_email; ?>" class="billing_fild"></td>
</tr>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">Tax Id</td>
<td>
<input name="taxid" id="taxid" type="text" value="<?php echo $current_user->taxid; ?>" class="billing_fild"></td>
</tr>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">New Password</td>
<td>
<input name="newpassword" id="pass" type="password" value="" class="billing_fild"></td>
</tr>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">Confirm Password</td>
<td>
<input name="Password" id="pass1" type="password" value="" class="billing_fild"></td>
</tr>
<tr style="background:#E9E9E9;">
<td colspan="2"><h2 style="padding-left: 10px;">Billing Address</h2></td>
</tr>
<?php
//echo "<pre>";
//print_r($field);
//echo "</pre>";
while($cunt<17)
{
$key=$arydata[$cunt];
$dtl=mysql_query("select * from wp_usermeta where user_id=$userid and meta_key='$key'");
$dtl1=mysql_fetch_assoc($dtl);
if($cunt==7)
{ ?>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">Country</td>
<td><select name="billing_country" id="calc_shipping_country" class="billing_fild" rel="calc_shipping_state">
<option value=""><?php _e('Select a country…', 'woocommerce'); ?></option>
<?php
foreach($woocommerce->countries->get_allowed_countries() as $key=>$value) :
echo '<option value="'.$key.'"';
if ($woocommerce->customer->get_shipping_country()==$key) echo 'selected="selected"';
echo '>'.$value.'</option>';
endforeach;
?>
</select> <i style="color:red">Insert the state below in short code like AL for Albama</i></td>
<td colspan="2"></td>
</tr>
<?php }
if($cunt==9)
{ ?>
<tr style="background:#E9E9E9;">
<td colspan="2"><h2 style="padding-left: 10px;">Shipping Address</h2></td>
</tr>
<?php }
if($cunt==16)
{ ?>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">Country</td>
<td><select name="shipping_country" id="calc_shipping_country" class="billing_fild" rel="calc_shipping_state">
<option value=""><?php _e('Select a country…', 'woocommerce'); ?></option>
<?php
foreach($woocommerce->countries->get_allowed_countries() as $key=>$value) :
echo '<option value="'.$key.'"';
if ($woocommerce->customer->get_shipping_country()==$key) echo 'selected="selected"';
echo '>'.$value.'</option>';
endforeach;
?>
</select> <i style="color:red">Insert the state below in short code like AL for Albama</i> </td>
<td colspan="2"></td>
</tr>
<?php }
?>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;"><?php echo $field[$cunt];?></td>
<td><input type="text" name="<?php echo $dtl1['meta_key'];?>" value="<?php echo $dtl1['meta_value'];?>" class="billing_fild"></td>
</tr>
<?php
$cunt++;
}?>
<?php /* while($dtl1=mysql_fetch_assoc($dtl))
{ ?>
<tr>
<td><input type="text" name="" value="<?php echo $dtl1['meta_value'];?>"></td>
</tr>
<?php
}*/
?>
<tr style="display:none;">
<td> </td>
<td><input type="text" name="ide" value="<?php echo $current_user->ID; ?>"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="update" value="" class="update_user"></td>
</tr>
</table>
</form>
</div>
<?php get_footer(); ?>
Apple MGXC2HN/A 15-inch Laptop (Core i7/16GB/512GB/Mac OS X Mavericks/NVIDIA GeForce GT 750M 2GB DDR5 Graphics/without Laptop Bag)
<?php
/*Template Name:User profile
*/
get_header(); ?>
<div class="c_right">
<?php
global $current_user , $woocommerce;
get_currentuserinfo();
// echo "<pre>";
//print_r($current_user);
//echo "</pre>";
$userid=$current_user->data->ID;
$arydata=array('first_name','last_name','billing_company','billing_address_1','billing_address_2'
,'billing_city','billing_postcode','billing_state','billing_phone','shipping_first_name','shipping_last_name','shipping_company','shipping_address_1','shipping_address_2','shipping_city'
,'shipping_postcode','shipping_state');
$field=array('First Name','Last Name','Company','Address 1','Address 2','City', 'Postcode','State','Phone','First Name','Last Name','Company','Address 1','Address 2','City','Postcode','State');
$cunt=count($arydata);
$cunt=count($field);
$cunt=0;
if(isset($_POST['update']))
{
$useremail=$_REQUEST['useremail'];
$password1=$_REQUEST['Password'];
$password=md5($password1);
$taxid=$_REQUEST['taxid'];
$user_id=$_REQUEST['ide'];
$username=$_REQUEST['username'];
$first_name=$_REQUEST['first_name'];
$last_name=$_REQUEST['last_name'];
$nickname=$_REQUEST['nickname'];
$billing_company=$_REQUEST['billing_company'];
$billing_address_1=$_REQUEST['billing_address_1'];
$billing_address_2=$_REQUEST['billing_address_2'];
$billing_city=$_REQUEST['billing_city'];
$billing_postcode=$_REQUEST['billing_postcode'];
$billing_country=$_REQUEST['billing_country'];
$billing_state=$_REQUEST['billing_state'];
$billing_email=$useremail;
$billing_phone=$_REQUEST['billing_phone'];
$billing_taxid=$taxid;
$shipping_first_name=$_REQUEST['shipping_first_name'];
$shipping_last_name=$_REQUEST['shipping_last_name'];
$shipping_company=$_REQUEST['shipping_company'];
$shipping_address_1=$_REQUEST['shipping_address_1'];
$shipping_address_2=$_REQUEST['shipping_address_2'];
$shipping_city=$_REQUEST['shipping_city'];
$shipping_postcode=$_REQUEST['shipping_postcode'];
$shipping_taxid=$taxid;
$shipping_country=$_REQUEST['shipping_country'];
$shipping_state=$_REQUEST['shipping_state'];
if($password1=="")
{
$update1="update wp_users set user_email='$useremail' where ID='$user_id'";
$update=mysql_query($update1);
update_user_meta($user_id,'billing_first_name',$first_name);
update_user_meta($user_id,'billing_last_name',$last_name);
update_user_meta($user_id,'nickname',$nickname);
update_user_meta($user_id,'billing_company',$billing_company);
update_user_meta($user_id,'billing_address_1',$billing_address_1);
update_user_meta($user_id,'billing_address_2',$billing_address_2);
update_user_meta($user_id,'billing_city',$billing_city);
update_user_meta($user_id,'billing_postcode',$billing_postcode);
update_user_meta($user_id,'billing_country',$billing_country);
update_user_meta($user_id,'billing_state',$billing_state);
update_user_meta($user_id,'billing_email',$billing_email);
update_user_meta($user_id,'billing_phone',$billing_phone);
update_user_meta($user_id,'billing_taxid',$billing_taxid);
update_user_meta($user_id,'shipping_first_name',$shipping_first_name);
update_user_meta($user_id,'shipping_last_name',$shipping_last_name);
update_user_meta($user_id,'shipping_company',$shipping_company);
update_user_meta($user_id,'shipping_address_1',$shipping_address_1);
update_user_meta($user_id,'shipping_address_2',$shipping_address_2);
update_user_meta($user_id,'shipping_city',$shipping_city);
update_user_meta($user_id,'shipping_postcode',$shipping_postcode);
update_user_meta($user_id,'shipping_taxid',$shipping_taxid);
update_user_meta($user_id,'shipping_country',$shipping_country);
update_user_meta($user_id,'shipping_state',$shipping_state);
update_user_meta($user_id,'taxid',$taxid);
}
else
{
$update1="update wp_users set user_email='$useremail' , user_pass='$password' where ID='$user_id'";
$update=mysql_query($update1);
update_user_meta($user_id,'billing_first_name',$first_name);
update_user_meta($user_id,'billing_last_name',$last_name);
update_user_meta($user_id,'nickname',$nickname);
update_user_meta($user_id,'billing_company',$billing_company);
update_user_meta($user_id,'billing_address_1',$billing_address_1);
update_user_meta($user_id,'billing_address_2',$billing_address_2);
update_user_meta($user_id,'billing_city',$billing_city);
update_user_meta($user_id,'billing_postcode',$billing_postcode);
update_user_meta($user_id,'billing_country',$billing_country);
update_user_meta($user_id,'billing_state',$billing_state);
update_user_meta($user_id,'billing_email',$billing_email);
update_user_meta($user_id,'billing_phone',$billing_phone);
update_user_meta($user_id,'taxid',$taxid);
update_user_meta($user_id,'shipping_first_name',$shipping_first_name);
update_user_meta($user_id,'shipping_last_name',$shipping_last_name);
update_user_meta($user_id,'shipping_company',$shipping_company);
update_user_meta($user_id,'shipping_address_1',$shipping_address_1);
update_user_meta($user_id,'shipping_address_2',$shipping_address_2);
update_user_meta($user_id,'shipping_city',$shipping_city);
update_user_meta($user_id,'shipping_postcode',$shipping_postcode);
update_user_meta($user_id,'shipping_taxid',$shipping_taxid);
update_user_meta($user_id,'shipping_country',$shipping_country);
update_user_meta($user_id,'shipping_state',$shipping_state);
}if($update)
{
echo "<p style='margin-left:200px;color:green;'>Info Updated</p>";
}
}
//echo $dtl2="select * from wp_usermeta where user_id=$userid";
// print_r($arydata);
/*while($cunt<14)
{
$key=$arydata[$cunt];
$dtl=mysql_query("select * from wp_usermeta where user_id=$userid and meta_key='$key'");
$dtl1=mysql_fetch_assoc($dtl);
echo $dtl1['meta_value']."<br/>";
$cunt++;
}*/
//echo "<pre>";
//print_r($dtl1);
//echo "</pre>";
global $current_user;
get_currentuserinfo();
?>
<script>
function validateForm()
{
var x=document.forms["frm1"]["useremail"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
{
alert("Not a valid e-mail address");
return false;
}
var x=document.forms["frm1"]["taxid"].value;
if (x==null || x=="")
{
alert("TaxId must be filled out");
return false;
}
}
</script>
<!--background:#E9E9E9; -->
<!--div style="float: right;
width: 730px;padding: 4px 0 5px 10px;font-family: Verdana;color: black;font-size: 12px;margin-top: 15px;height:auto;"-->
<div class="register1">
<form name="frm1" method="post" action="" onsubmit="return validateForm()">
<input type="hidden" id="hdnSubmit_frm" name="hdnSubmit_frm" value="insert" />
<table style="width:100% !important">
<tr style="background:#E9E9E9;">
<td colspan="2"><h2 style="padding-left: 10px;">User Profile<h2></td></tr>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">Name</td>
<td>
<input name="username" id="username" type="text" value="<?php echo $current_user->user_login ;?>" class="billing_fild" readonly="readonly"><i style="color:red">unable to change username</i></td>
</tr>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">Email Address</td>
<td><input name="useremail" id="useremail" type="text" value="<?php echo $current_user->user_email; ?>" class="billing_fild"></td>
</tr>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">Tax Id</td>
<td>
<input name="taxid" id="taxid" type="text" value="<?php echo $current_user->taxid; ?>" class="billing_fild"></td>
</tr>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">New Password</td>
<td>
<input name="newpassword" id="pass" type="password" value="" class="billing_fild"></td>
</tr>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">Confirm Password</td>
<td>
<input name="Password" id="pass1" type="password" value="" class="billing_fild"></td>
</tr>
<tr style="background:#E9E9E9;">
<td colspan="2"><h2 style="padding-left: 10px;">Billing Address</h2></td>
</tr>
<?php
//echo "<pre>";
//print_r($field);
//echo "</pre>";
while($cunt<17)
{
$key=$arydata[$cunt];
$dtl=mysql_query("select * from wp_usermeta where user_id=$userid and meta_key='$key'");
$dtl1=mysql_fetch_assoc($dtl);
if($cunt==7)
{ ?>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">Country</td>
<td><select name="billing_country" id="calc_shipping_country" class="billing_fild" rel="calc_shipping_state">
<option value=""><?php _e('Select a country…', 'woocommerce'); ?></option>
<?php
foreach($woocommerce->countries->get_allowed_countries() as $key=>$value) :
echo '<option value="'.$key.'"';
if ($woocommerce->customer->get_shipping_country()==$key) echo 'selected="selected"';
echo '>'.$value.'</option>';
endforeach;
?>
</select> <i style="color:red">Insert the state below in short code like AL for Albama</i></td>
<td colspan="2"></td>
</tr>
<?php }
if($cunt==9)
{ ?>
<tr style="background:#E9E9E9;">
<td colspan="2"><h2 style="padding-left: 10px;">Shipping Address</h2></td>
</tr>
<?php }
if($cunt==16)
{ ?>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;">Country</td>
<td><select name="shipping_country" id="calc_shipping_country" class="billing_fild" rel="calc_shipping_state">
<option value=""><?php _e('Select a country…', 'woocommerce'); ?></option>
<?php
foreach($woocommerce->countries->get_allowed_countries() as $key=>$value) :
echo '<option value="'.$key.'"';
if ($woocommerce->customer->get_shipping_country()==$key) echo 'selected="selected"';
echo '>'.$value.'</option>';
endforeach;
?>
</select> <i style="color:red">Insert the state below in short code like AL for Albama</i> </td>
<td colspan="2"></td>
</tr>
<?php }
?>
<tr>
<td style="background:#F5F5F5;padding-left: 10px;"><?php echo $field[$cunt];?></td>
<td><input type="text" name="<?php echo $dtl1['meta_key'];?>" value="<?php echo $dtl1['meta_value'];?>" class="billing_fild"></td>
</tr>
<?php
$cunt++;
}?>
<?php /* while($dtl1=mysql_fetch_assoc($dtl))
{ ?>
<tr>
<td><input type="text" name="" value="<?php echo $dtl1['meta_value'];?>"></td>
</tr>
<?php
}*/
?>
<tr style="display:none;">
<td> </td>
<td><input type="text" name="ide" value="<?php echo $current_user->ID; ?>"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="update" value="" class="update_user"></td>
</tr>
</table>
</form>
</div>
<?php get_footer(); ?>
Apple MGXC2HN/A 15-inch Laptop (Core i7/16GB/512GB/Mac OS X Mavericks/NVIDIA GeForce GT 750M 2GB DDR5 Graphics/without Laptop Bag)
define('AWS_ACCESS_KEY_ID', 'AKIAIILWAC3S7EFN2AQQ');
ReplyDeletedefine('AWS_SECRET_ACCESS_KEY', '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');
define('AMAZON_ASSOC_TAG', 'phpwordpr-20');
http://www.nsp-code.com/premium-plugins/wordpress-plugins/wp-e-commerce-purolator-shipping/
ReplyDelete