function create_menu() {
add_menu_page('cm panel', 'Resigistration', 'subscriber', __FILE__, 'settings_page');
add_submenu_page( __FILE__, 'New_Resigistration', 'New_Resigistration', 'manage_options', 'my-submenu-handle1','settings_page');
add_submenu_page( __FILE__, 'User_Details', 'User_Details', 'read', 'my-submenu-handle2','section_1');
add_submenu_page( __FILE__, '', '', 'manage_options', 'my-submenu-handle3','section_2');
add_submenu_page( __FILE__, 'Old Dancer', '', 'manage_options', 'my-submenu-handle4','section_3');
}
function settings_page()
{
include('upload1.php');
}
function section_1()
{
include('floor_image.php');
//include(ABSPATH.'wp-content/themes/CherryFramework/front_display.php');
}
function section_3()
{
include('oldpage.php');
}
function section_2()
{
$gid=$_GET['id'];
$a="select * from wp_usersinfo where id=$gid";
$res=mysql_query($a);
?>
<form action="" method="post" class="regty" enctype="multipart/form-data">
<?php
while($row=mysql_fetch_array($res))
{
//print_r($row);
?>
<div class="nn1"><span class="lab1">Name</span> <input type="text" name="name_2" value="<?php echo $row['name'];?>"/></div>
<div class="nn1"><span class="lab1">DOC</span> <input type="text" name="doc_2" value="<?php echo $row['doc'];?>" /></div>
<div class="nn1"><span class="lab1">Cell</span> <input type="text" name="cell_2" value="<?php echo $row['cell'];?>" /></div>
<div class="nn1"><span class="lab1">Prison</span> <input type="text" name="prison_2" value="<?php echo $row['prison'];?>"/></div>
<div class="nn1"><span class="lab1">Address</span><textarea cols="59" rows="5" name="address_2"><?php echo $row['address'];?></textarea></div>
<div class="nn1"><span class="lab1">City</span> <input type="text" name="city_2" value="<?php echo $row['city'];?>"/></div>
<div class="nn1"><span class="lab1">State</span> <input type="text" name="state_2" value="<?php echo $row['state'];?>"/></div>
<div class="nn1"><span class="lab1">Zip</span> <input type="text" name="zip_2" value="<?php echo $row['zip'];?>"/></div>
<div class="nn1"><span class="lab1">DOB</span> <input type="text" name="dob_2" value="<?php echo $row['dob'];?>" placeholder="dd/mm/yyyy"/></div>
<div class="nn1"><span class="lab1">
<input type="radio" name="gender2" value="female">Female
<input type="radio" name="gender2" value="male">Male
</div>
<div class="nn1"><span class="lab1">Height</span><input type="text" name="height_2" value="<?php echo $row['height'];?>" /></div>
<div class="nn1"><span class="lab1">Weight</span><input type="text" name="weight_2" value="<?php echo $row['weight'];?>"/></div>
<div class="nn1"><span class="lab1">Hair </span><input type="text" name="hair_color_2" value="<?php echo $row['hair'];?>" /></div>
<div class="nn1"><span class="lab1">Eyes</span><input type="text" name="eyes2" value="<?php echo $row['eyes'];?>" /></div>
<div class="nn1"><span class="lab1">Race</span><input type="text" name="race2" value="<?php echo $row['race'];?>"/></div>
<div class="nn1"><span class="lab1">Sexual Preference</span><input type="text" name="sexual_preference2" value="<?php echo $row['sexual_preference'];?>" /></div>
<div class="nn1"><span class="lab1">Seeking</span><input type="text" name="seeking2" value="<?php echo $row['seeking'];?>" /></div>
<div class="nn1"><span class="lab1">Personality</span><input type="text" name="personality2" value="<?php echo $row['personality'];?>" /></div>
<div class="nn1"><span class="lab1">New Inmates</span><input type="text" name="new_inmates2" value="<?php echo $row['new_inmates'];?>" /></div>
<div class="nn1"><span class="lab1">Wrongfully Convicted</span><input type="text" name="wrongfully_convicted2" value="<?php echo $row['wrongfully_convicted'];?>" /></div>
<div class="nn1"><span class="lab1">Lifer's</span><input type="text" name="lifers2" value="<?php echo $row['lifers'];?>" /></div>
<div class="nn1"><span class="lab1">Death Row</span><input type="text" name="deathrow2" value="<?php echo $row['deathrow'];?>" /></div>
<div class="nn1"><span class="lab1">Ad Expires</span><input type="text" name="adexpires2" value="<?php echo $row['adexpires'];?>" /></div>
<div class="nn1"><span class="lab1">Crime</span><input type="text" name="crime2" value="<?php echo $row['crime'];?>"/></div>
<div class="nn1"><span class="lab1">Expected Release Date</span><input type="text" name="expected_release_date2" value="<?php echo $row['expected_release_date'];?>" placeholder="yyyy/mm/dd" /></div>
<div class="nn1"><span class="lab1">Maximum Release Date</span><input type="text" name="maximum_release_date2" value="<?php echo $row['maximum_release_date'];?>" placeholder="yyyy/mm/dd"/></div>
<div class="nn1"><span class="lab1">Parole Date</span><input type="text" name="parole_date2" value="<?php echo $row['parole'];?>" placeholder="yyyy/mm/dd or NA"/></div>
<div class="nn1"><span class="lab1">Marital Status</span><input type="text" name="marital_status2" value="<?php echo $row['marital_status'];?>" /></div>
<div class="nn1"><span class="lab1">Have Children</span><input type="text" name="have_children2" value="<?php echo $row['have_children'];?>" /></div>
<div class="nn1"><span class="lab1">Want Children</span><input type="text" name="want_children2" value="<?php echo $row['want_children'];?>"/></div>
<div class="nn1"><span class="lab1">Home Town</span><input type="text" name="home_town_2" value="<?php echo $row['hometown'];?>" /></div>
<div class="nn1"><span class="lab1">Faith</span><input type="text" name="faith_2" value="<?php echo $row['faith'];?>"/></div>
<div class="nn1"><span class="lab1">Speaks</span><input type="text" name="speaks_2" value="<?php echo $row['speaks'];?>" /></div>
<div class="nn1"><span class="lab1">Hobbies</span><input type="text" name="hobbies_2" value="<?php echo $row['hobbies'];?>"/></div>
<div class="nn1"><span class="lab1">Bust</span><input type="text" name="bust_2" value="<?php echo $row['bust'];?>"/></div>
<div class="nn1"><span class="lab1">About us</span><textarea cols="59" rows="5" name="about_us_2"><?php echo $row['aboutus'];?></textarea></div>
<div class="nn1"><span class="lab1">Upload Profile image</span><input type="file" name="Photo" />
<img src="<?php echo bloginfo('template_url').'/images/'.$row['image_name']; ?>" width="125" height="100">
</div>
<div id="mainbody" >
<!--
<div id="upload" ><span>Upload thumbnail images<span></div><span id="status" ></span>
-->
<span style="">
<?php
if($row['t_images']!=''){
$timg=explode(',', $row['t_images']);
foreach($timg as $dimg){
if($dimg != ''){
$imgpath = pathinfo($dimg);
?>
<li id="imgj<?php echo $imgpath['filename']; ?>" onclick="removeimg(this.id);">
<!---<li>---->
<img src="<?php echo $dimg; ?>" height="100" width="200" >
<input type="hidden" name="image[]" value="<?php echo $dimg; ?>" >
</li>
<?php }
} }
//echo '</ul>';
?>
</span>
<!-- <ul id="files" ></ul> -->
<!-- <input type="text" name="vi" value="<?php //echo $row['video']; ?>"> -->
</div>
<!--
<?php //if($row['checkbox'] == 1) {?>
Move To Old Page <input type="checkbox" name="chkbox" value="1" checked="checked" />
<?php //} else { ?>
Move To Old Page <input type="checkbox" name="chkbox" value="0" />
<?php //}?>
-->
<div class="nn1"><input type="submit" name="update" value="Update" class="subtn"></div>
<?php
}
?>
</form>
<?php
////////////////////////////////
if(isset($_POST['update']))
{
if(isset($_POST['chkbox']))
{
$chk = 1;
}
else
{
$chk = 0;
}
$imgv='';
if(isset($_POST['image'])){
$imgp =$_POST['image'];
foreach ($imgp as $value)
{
$imgv .= $value.",";
}
}
print_r($_FILES);
if($_FILES['Photo']['error']==0)
{
$uploadDir = get_template_directory().'/images/';
$fileName = $_FILES['Photo']['name'];
$tmpName = $_FILES['Photo']['tmp_name'];
$fileSize = $_FILES['Photo']['size'];
$fileType = $_FILES['Photo']['type'];
$filePath = $uploadDir.$fileName;
$livepath=bloginfo('template_url').'/images/'.$fileName;
$result = move_uploaded_file($tmpName, $filePath);
if (!$result) {
echo "Error uploading file";
exit;
}
if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
$filePath = addslashes($filePath);
//$imgpath=$url.$fileName;
}
$a="UPDATE wp_usersinfo SET name='".$_POST['name_2']."'
,doc='".$_POST['doc_2']."',
cell='".$_POST['cell_2']."',
prison='".$_POST['prison_2']."',
address='".$_POST['address_2']."',
city='".$_POST['city_2']."',
dob='".$_POST['dob_2']."',
gender = '".$_POST['gender2']."',
height='".$_POST['height_2']."',
weight='".$_POST['weight_2']."',
hair='".$_POST['hair_color_2']."',
eyes='".$_POST['eyes2']."',
race ='".$_POST['race2']."',
state ='".$_POST['state_2']."',
zip ='".$_POST['zip_2']."',
personality ='".$_POST['personality2']."',
new_inmates ='".$_POST['new_inmates2']."',
wrongfully_convicted ='".$_POST['wrongfully_convicted2']."',
lifers ='".$_POST['lifers2']."',
deathrow ='".$_POST['deathrow2']."',
adexpires ='".$_POST['adexpires2']."',
sexual_preference = '".$_POST['sexual_preference2']."',
parole='".$_POST['parole_date2']."',
hometown='".$_POST['home_town_2']."',
faith='".$_POST['faith_2']."',
seeking ='".$_POST['seeking2']."',
crime = '".$_POST['crime2']."',
bust='".$_POST['bust_2']."',
expected_release_date ='".$_POST['expected_release_date2']."',
maximum_release_date ='".$_POST['maximum_release_date2']."',
marital_status = '".$_POST['marital_status2']."',
have_children = '".$_POST['have_children2']."',
want_children = '".$_POST['want_children2']."',
speaks='".$_POST['speaks_2']."',
hobbies='".$_POST['hobbies_2']."',
image_name='".$fileName."',
image_path='".$filePath."',
t_images='".$imgv."',
checkbox = '".$chk."',
aboutus='".$_POST['about_us_2']."'
where id='$gid'";
}
else
{
$a="UPDATE wp_usersinfo SET name='".$_POST['name_2']."'
,doc='".$_POST['doc_2']."',
cell='".$_POST['cell_2']."',
prison='".$_POST['prison_2']."',
address='".$_POST['address_2']."',
city='".$_POST['city_2']."',
dob='".$_POST['dob_2']."',
state ='".$_POST['state_2']."',
zip ='".$_POST['zip_2']."',
personality ='".$_POST['personality2']."',
new_inmates ='".$_POST['new_inmates2']."',
wrongfully_convicted ='".$_POST['wrongfully_convicted2']."',
lifers ='".$_POST['lifers2']."',
deathrow ='".$_POST['deathrow2']."',
adexpires ='".$_POST['adexpires2']."',
gender = '".$_POST['gender2']."',
height='".$_POST['height_2']."',
weight='".$_POST['weight_2']."',
hair='".$_POST['hair_color_2']."',
eyes='".$_POST['eyes2']."',
race ='".$_POST['race2']."',
sexual_preference = '".$_POST['sexual_preference2']."',
parole='".$_POST['parole_date2']."',
hometown='".$_POST['home_town_2']."',
faith='".$_POST['faith_2']."',
seeking ='".$_POST['seeking2']."',
crime = '".$_POST['crime2']."',
bust='".$_POST['bust_2']."',
expected_release_date ='".$_POST['expected_release_date2']."',
maximum_release_date ='".$_POST['maximum_release_date2']."',
marital_status = '".$_POST['marital_status2']."',
have_children = '".$_POST['have_children2']."',
want_children = '".$_POST['want_children2']."',
speaks='".$_POST['speaks_2']."',
hobbies='".$_POST['hobbies_2']."',
image_name='".$fileName."',
image_path='".$filePath."',
t_images='".$imgv."',
checkbox = '".$chk."',
aboutus='".$_POST['about_us_2']."'
where id='$gid'";
}
mysql_query($a);
$admin = admin_url();
header('location:'.$admin.'admin.php?page=my-submenu-handle2');
//header('location:'.$admin.'admin.php?page=my-submenu-handle3&id='.$gid);
}
}
//////////////////////////////////
?>
<?php
function myplugin_activate()
{
global $wpdb;
$table = 'wp_usersinfo';
$sql= "CREATE TABLE $table
(id INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
name VARCHAR(250),
age VARCHAR( 250 ) NULL ,
eyes VARCHAR( 250 ) NULL ,
race VARCHAR( 250 ) NULL ,
sexual_preference VARCHAR( 250 ) NULL ,
seeking VARCHAR( 250 ) NULL ,
crime VARCHAR( 250 ) NULL ,
expected_release_date VARCHAR( 250 ) NULL ,
maximum_release_date VARCHAR( 250 ) NULL ,
marital_status VARCHAR( 250 ) NULL ,
have_children VARCHAR( 250 ) NULL ,
want_children VARCHAR( 250 ) NULL ,
gender VARCHAR( 250 ) NULL ,
city VARCHAR( 250 ) NULL ,
height VARCHAR( 250 ) NULL ,
bust VARCHAR( 250 ) NULL ,
hair VARCHAR( 250 ) NULL ,
speaks VARCHAR( 250 ) NULL ,
hobbies VARCHAR( 250 ) NULL ,
image_name VARCHAR( 250 ) NULL ,
image_path VARCHAR( 250 ) NULL ,
t_images VARCHAR( 250 ) NULL ,
video VARCHAR( 250 ) NULL ,
checkbox VARCHAR( 250 ) NULL ,
aboutus MEDIUMTEXT NULL ,
fileUploadedOn DATETIME NOT NULL )";
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($sql);
}
register_activation_hook( __FILE__, 'myplugin_activate' );
add_action('admin_menu','create_menu');
//add_shortcode('display', 'section_1');
?>
add_menu_page('cm panel', 'Resigistration', 'subscriber', __FILE__, 'settings_page');
add_submenu_page( __FILE__, 'New_Resigistration', 'New_Resigistration', 'manage_options', 'my-submenu-handle1','settings_page');
add_submenu_page( __FILE__, 'User_Details', 'User_Details', 'read', 'my-submenu-handle2','section_1');
add_submenu_page( __FILE__, '', '', 'manage_options', 'my-submenu-handle3','section_2');
add_submenu_page( __FILE__, 'Old Dancer', '', 'manage_options', 'my-submenu-handle4','section_3');
}
function settings_page()
{
include('upload1.php');
}
function section_1()
{
include('floor_image.php');
//include(ABSPATH.'wp-content/themes/CherryFramework/front_display.php');
}
function section_3()
{
include('oldpage.php');
}
function section_2()
{
$gid=$_GET['id'];
$a="select * from wp_usersinfo where id=$gid";
$res=mysql_query($a);
?>
<form action="" method="post" class="regty" enctype="multipart/form-data">
<?php
while($row=mysql_fetch_array($res))
{
//print_r($row);
?>
<div class="nn1"><span class="lab1">Name</span> <input type="text" name="name_2" value="<?php echo $row['name'];?>"/></div>
<div class="nn1"><span class="lab1">DOC</span> <input type="text" name="doc_2" value="<?php echo $row['doc'];?>" /></div>
<div class="nn1"><span class="lab1">Cell</span> <input type="text" name="cell_2" value="<?php echo $row['cell'];?>" /></div>
<div class="nn1"><span class="lab1">Prison</span> <input type="text" name="prison_2" value="<?php echo $row['prison'];?>"/></div>
<div class="nn1"><span class="lab1">Address</span><textarea cols="59" rows="5" name="address_2"><?php echo $row['address'];?></textarea></div>
<div class="nn1"><span class="lab1">City</span> <input type="text" name="city_2" value="<?php echo $row['city'];?>"/></div>
<div class="nn1"><span class="lab1">State</span> <input type="text" name="state_2" value="<?php echo $row['state'];?>"/></div>
<div class="nn1"><span class="lab1">Zip</span> <input type="text" name="zip_2" value="<?php echo $row['zip'];?>"/></div>
<div class="nn1"><span class="lab1">DOB</span> <input type="text" name="dob_2" value="<?php echo $row['dob'];?>" placeholder="dd/mm/yyyy"/></div>
<div class="nn1"><span class="lab1">
<input type="radio" name="gender2" value="female">Female
<input type="radio" name="gender2" value="male">Male
</div>
<div class="nn1"><span class="lab1">Height</span><input type="text" name="height_2" value="<?php echo $row['height'];?>" /></div>
<div class="nn1"><span class="lab1">Weight</span><input type="text" name="weight_2" value="<?php echo $row['weight'];?>"/></div>
<div class="nn1"><span class="lab1">Hair </span><input type="text" name="hair_color_2" value="<?php echo $row['hair'];?>" /></div>
<div class="nn1"><span class="lab1">Eyes</span><input type="text" name="eyes2" value="<?php echo $row['eyes'];?>" /></div>
<div class="nn1"><span class="lab1">Race</span><input type="text" name="race2" value="<?php echo $row['race'];?>"/></div>
<div class="nn1"><span class="lab1">Sexual Preference</span><input type="text" name="sexual_preference2" value="<?php echo $row['sexual_preference'];?>" /></div>
<div class="nn1"><span class="lab1">Seeking</span><input type="text" name="seeking2" value="<?php echo $row['seeking'];?>" /></div>
<div class="nn1"><span class="lab1">Personality</span><input type="text" name="personality2" value="<?php echo $row['personality'];?>" /></div>
<div class="nn1"><span class="lab1">New Inmates</span><input type="text" name="new_inmates2" value="<?php echo $row['new_inmates'];?>" /></div>
<div class="nn1"><span class="lab1">Wrongfully Convicted</span><input type="text" name="wrongfully_convicted2" value="<?php echo $row['wrongfully_convicted'];?>" /></div>
<div class="nn1"><span class="lab1">Lifer's</span><input type="text" name="lifers2" value="<?php echo $row['lifers'];?>" /></div>
<div class="nn1"><span class="lab1">Death Row</span><input type="text" name="deathrow2" value="<?php echo $row['deathrow'];?>" /></div>
<div class="nn1"><span class="lab1">Ad Expires</span><input type="text" name="adexpires2" value="<?php echo $row['adexpires'];?>" /></div>
<div class="nn1"><span class="lab1">Crime</span><input type="text" name="crime2" value="<?php echo $row['crime'];?>"/></div>
<div class="nn1"><span class="lab1">Expected Release Date</span><input type="text" name="expected_release_date2" value="<?php echo $row['expected_release_date'];?>" placeholder="yyyy/mm/dd" /></div>
<div class="nn1"><span class="lab1">Maximum Release Date</span><input type="text" name="maximum_release_date2" value="<?php echo $row['maximum_release_date'];?>" placeholder="yyyy/mm/dd"/></div>
<div class="nn1"><span class="lab1">Parole Date</span><input type="text" name="parole_date2" value="<?php echo $row['parole'];?>" placeholder="yyyy/mm/dd or NA"/></div>
<div class="nn1"><span class="lab1">Marital Status</span><input type="text" name="marital_status2" value="<?php echo $row['marital_status'];?>" /></div>
<div class="nn1"><span class="lab1">Have Children</span><input type="text" name="have_children2" value="<?php echo $row['have_children'];?>" /></div>
<div class="nn1"><span class="lab1">Want Children</span><input type="text" name="want_children2" value="<?php echo $row['want_children'];?>"/></div>
<div class="nn1"><span class="lab1">Home Town</span><input type="text" name="home_town_2" value="<?php echo $row['hometown'];?>" /></div>
<div class="nn1"><span class="lab1">Faith</span><input type="text" name="faith_2" value="<?php echo $row['faith'];?>"/></div>
<div class="nn1"><span class="lab1">Speaks</span><input type="text" name="speaks_2" value="<?php echo $row['speaks'];?>" /></div>
<div class="nn1"><span class="lab1">Hobbies</span><input type="text" name="hobbies_2" value="<?php echo $row['hobbies'];?>"/></div>
<div class="nn1"><span class="lab1">Bust</span><input type="text" name="bust_2" value="<?php echo $row['bust'];?>"/></div>
<div class="nn1"><span class="lab1">About us</span><textarea cols="59" rows="5" name="about_us_2"><?php echo $row['aboutus'];?></textarea></div>
<div class="nn1"><span class="lab1">Upload Profile image</span><input type="file" name="Photo" />
<img src="<?php echo bloginfo('template_url').'/images/'.$row['image_name']; ?>" width="125" height="100">
</div>
<div id="mainbody" >
<!--
<div id="upload" ><span>Upload thumbnail images<span></div><span id="status" ></span>
-->
<span style="">
<?php
if($row['t_images']!=''){
$timg=explode(',', $row['t_images']);
foreach($timg as $dimg){
if($dimg != ''){
$imgpath = pathinfo($dimg);
?>
<li id="imgj<?php echo $imgpath['filename']; ?>" onclick="removeimg(this.id);">
<!---<li>---->
<img src="<?php echo $dimg; ?>" height="100" width="200" >
<input type="hidden" name="image[]" value="<?php echo $dimg; ?>" >
</li>
<?php }
} }
//echo '</ul>';
?>
</span>
<!-- <ul id="files" ></ul> -->
<!-- <input type="text" name="vi" value="<?php //echo $row['video']; ?>"> -->
</div>
<!--
<?php //if($row['checkbox'] == 1) {?>
Move To Old Page <input type="checkbox" name="chkbox" value="1" checked="checked" />
<?php //} else { ?>
Move To Old Page <input type="checkbox" name="chkbox" value="0" />
<?php //}?>
-->
<div class="nn1"><input type="submit" name="update" value="Update" class="subtn"></div>
<?php
}
?>
</form>
<?php
////////////////////////////////
if(isset($_POST['update']))
{
if(isset($_POST['chkbox']))
{
$chk = 1;
}
else
{
$chk = 0;
}
$imgv='';
if(isset($_POST['image'])){
$imgp =$_POST['image'];
foreach ($imgp as $value)
{
$imgv .= $value.",";
}
}
print_r($_FILES);
if($_FILES['Photo']['error']==0)
{
$uploadDir = get_template_directory().'/images/';
$fileName = $_FILES['Photo']['name'];
$tmpName = $_FILES['Photo']['tmp_name'];
$fileSize = $_FILES['Photo']['size'];
$fileType = $_FILES['Photo']['type'];
$filePath = $uploadDir.$fileName;
$livepath=bloginfo('template_url').'/images/'.$fileName;
$result = move_uploaded_file($tmpName, $filePath);
if (!$result) {
echo "Error uploading file";
exit;
}
if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
$filePath = addslashes($filePath);
//$imgpath=$url.$fileName;
}
$a="UPDATE wp_usersinfo SET name='".$_POST['name_2']."'
,doc='".$_POST['doc_2']."',
cell='".$_POST['cell_2']."',
prison='".$_POST['prison_2']."',
address='".$_POST['address_2']."',
city='".$_POST['city_2']."',
dob='".$_POST['dob_2']."',
gender = '".$_POST['gender2']."',
height='".$_POST['height_2']."',
weight='".$_POST['weight_2']."',
hair='".$_POST['hair_color_2']."',
eyes='".$_POST['eyes2']."',
race ='".$_POST['race2']."',
state ='".$_POST['state_2']."',
zip ='".$_POST['zip_2']."',
personality ='".$_POST['personality2']."',
new_inmates ='".$_POST['new_inmates2']."',
wrongfully_convicted ='".$_POST['wrongfully_convicted2']."',
lifers ='".$_POST['lifers2']."',
deathrow ='".$_POST['deathrow2']."',
adexpires ='".$_POST['adexpires2']."',
sexual_preference = '".$_POST['sexual_preference2']."',
parole='".$_POST['parole_date2']."',
hometown='".$_POST['home_town_2']."',
faith='".$_POST['faith_2']."',
seeking ='".$_POST['seeking2']."',
crime = '".$_POST['crime2']."',
bust='".$_POST['bust_2']."',
expected_release_date ='".$_POST['expected_release_date2']."',
maximum_release_date ='".$_POST['maximum_release_date2']."',
marital_status = '".$_POST['marital_status2']."',
have_children = '".$_POST['have_children2']."',
want_children = '".$_POST['want_children2']."',
speaks='".$_POST['speaks_2']."',
hobbies='".$_POST['hobbies_2']."',
image_name='".$fileName."',
image_path='".$filePath."',
t_images='".$imgv."',
checkbox = '".$chk."',
aboutus='".$_POST['about_us_2']."'
where id='$gid'";
}
else
{
$a="UPDATE wp_usersinfo SET name='".$_POST['name_2']."'
,doc='".$_POST['doc_2']."',
cell='".$_POST['cell_2']."',
prison='".$_POST['prison_2']."',
address='".$_POST['address_2']."',
city='".$_POST['city_2']."',
dob='".$_POST['dob_2']."',
state ='".$_POST['state_2']."',
zip ='".$_POST['zip_2']."',
personality ='".$_POST['personality2']."',
new_inmates ='".$_POST['new_inmates2']."',
wrongfully_convicted ='".$_POST['wrongfully_convicted2']."',
lifers ='".$_POST['lifers2']."',
deathrow ='".$_POST['deathrow2']."',
adexpires ='".$_POST['adexpires2']."',
gender = '".$_POST['gender2']."',
height='".$_POST['height_2']."',
weight='".$_POST['weight_2']."',
hair='".$_POST['hair_color_2']."',
eyes='".$_POST['eyes2']."',
race ='".$_POST['race2']."',
sexual_preference = '".$_POST['sexual_preference2']."',
parole='".$_POST['parole_date2']."',
hometown='".$_POST['home_town_2']."',
faith='".$_POST['faith_2']."',
seeking ='".$_POST['seeking2']."',
crime = '".$_POST['crime2']."',
bust='".$_POST['bust_2']."',
expected_release_date ='".$_POST['expected_release_date2']."',
maximum_release_date ='".$_POST['maximum_release_date2']."',
marital_status = '".$_POST['marital_status2']."',
have_children = '".$_POST['have_children2']."',
want_children = '".$_POST['want_children2']."',
speaks='".$_POST['speaks_2']."',
hobbies='".$_POST['hobbies_2']."',
image_name='".$fileName."',
image_path='".$filePath."',
t_images='".$imgv."',
checkbox = '".$chk."',
aboutus='".$_POST['about_us_2']."'
where id='$gid'";
}
mysql_query($a);
$admin = admin_url();
header('location:'.$admin.'admin.php?page=my-submenu-handle2');
//header('location:'.$admin.'admin.php?page=my-submenu-handle3&id='.$gid);
}
}
//////////////////////////////////
?>
<?php
function myplugin_activate()
{
global $wpdb;
$table = 'wp_usersinfo';
$sql= "CREATE TABLE $table
(id INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
name VARCHAR(250),
age VARCHAR( 250 ) NULL ,
eyes VARCHAR( 250 ) NULL ,
race VARCHAR( 250 ) NULL ,
sexual_preference VARCHAR( 250 ) NULL ,
seeking VARCHAR( 250 ) NULL ,
crime VARCHAR( 250 ) NULL ,
expected_release_date VARCHAR( 250 ) NULL ,
maximum_release_date VARCHAR( 250 ) NULL ,
marital_status VARCHAR( 250 ) NULL ,
have_children VARCHAR( 250 ) NULL ,
want_children VARCHAR( 250 ) NULL ,
gender VARCHAR( 250 ) NULL ,
city VARCHAR( 250 ) NULL ,
height VARCHAR( 250 ) NULL ,
bust VARCHAR( 250 ) NULL ,
hair VARCHAR( 250 ) NULL ,
speaks VARCHAR( 250 ) NULL ,
hobbies VARCHAR( 250 ) NULL ,
image_name VARCHAR( 250 ) NULL ,
image_path VARCHAR( 250 ) NULL ,
t_images VARCHAR( 250 ) NULL ,
video VARCHAR( 250 ) NULL ,
checkbox VARCHAR( 250 ) NULL ,
aboutus MEDIUMTEXT NULL ,
fileUploadedOn DATETIME NOT NULL )";
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($sql);
}
register_activation_hook( __FILE__, 'myplugin_activate' );
add_action('admin_menu','create_menu');
//add_shortcode('display', 'section_1');
?>
No comments:
Post a Comment