Guest User

Untitled

a guest
May 30th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 113.38 KB | None | 0 0
  1. <?php
  2. Error_reporting(0);
  3. session_start();
  4. global $wpdb;
  5. /*
  6. Plugin Name: Membership_Dashboard plugin
  7. Description: A test plugin to demonstrate wordpress functionality
  8. Author: Simon Lissack
  9. Version: 0.1
  10. */
  11.  
  12. add_action('admin_menu', 'membership_plugin_setup_menu');
  13.  
  14. function membership_plugin_setup_menu(){
  15.     add_menu_page( 'Membership pro Plugin Page', 'Membership Dashboard', 'read', 'membership-plugin','membership_pro_init' , '','7');
  16.     add_submenu_page('membership-plugin', 'Add Client', 'Add client', 'read', __FILE__.'/clients', 'clivern_render_client_page');
  17.     add_submenu_page('membership-plugin', 'Add Employees', 'Add Assistant', 'read', __FILE__.'/assign-tasks', 'clivern_employee_page');
  18.     add_submenu_page('membership-plugin', 'Task List', 'Task List', 'read', __FILE__.'/task-list', 'clivern_task_list_page');
  19.     add_submenu_page('membership-plugin', 'Registered Client', 'Registered Client', 'read', __FILE__.'/registered_clients', 'clivern_register_page');
  20.     add_submenu_page('membership-plugin', 'Assign List', 'Assign List', 'read', __FILE__.'/employee', 'clivern_assign_list_page');
  21.  
  22. }
  23.  
  24. /************ Registered clients  ******************/
  25. function clivern_register_page(){  $sess_id = $_SESSION['lastid'];  
  26.     ?>
  27.  
  28.  
  29. <script>
  30.     jQuery(document).ready(function(){
  31.         jQuery(".task_field").on('change',function() {
  32.         var x = jQuery(this).val();
  33.         var mst_field = jQuery("#mst_field").val(x);
  34.             var datae = jQuery(this).val();
  35.             var url = 'http://www.seocheatguides.com/wp-admin/admin.php?page=Membership_dashborad%2Fmembership_dashboard.php%2Fregistered_clients&member=' + datae;
  36.             jQuery(location).attr('href', url);
  37.         });
  38.     });
  39. </script>
  40.  
  41. <style>
  42. .please-enter-any-two-digits{
  43. display:none;}
  44. .verification{
  45. display:none;}
  46. .submit{
  47. display:none;}
  48. .fieldset{
  49. display:none;}
  50. </style>
  51. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  52. <script>
  53. jQuery(document).ready(function(){
  54.  
  55. jQuery('#business_phone').on('keyup',function()
  56.   {
  57.     this.value = this.value.replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,'$1-$2-$3');
  58.     return false; });
  59.  
  60. jQuery(".submit_email_data").click(function(){
  61. var cur_Id = jQuery(this).attr('id');
  62. jQuery("#cur_Id").val(cur_Id);
  63.  
  64. var cur_value = jQuery("#cur_value").val();
  65.  
  66. var cur_name = jQuery("#cur_name").val();
  67.  
  68. var cur_employee = jQuery("#cur_employee").val();
  69.  
  70. });
  71.  
  72. });
  73. </script>
  74. <?php
  75.   global $wpdb;
  76.   $chk_business  = $wpdb->get_results("SELECT * FROM wpmw_users where user_login = '$_GET[member]'") ;
  77.   foreach($chk_business  as $checkd){
  78.  
  79.     $checkd_id = $checkd->ID;
  80.     $meta = get_user_meta( $checkd_id );
  81.     $meta['business_name'][0];
  82. }
  83. ?>
  84.  
  85. <script>
  86. jQuery(document).ready(function(){
  87. jQuery(".cli_task").on("click", function(){
  88.  var field = jQuery(this).attr('field');
  89. //alert(field);
  90.  
  91. });
  92.             jQuery(".job").fadeOut(3000);
  93. });
  94. </script>
  95. <table class="widefat membership-levels" id="table-name" BORDER="1" WIDTH="40%" CELLSPACING="3">
  96. <h3 style= "text-align:center"><?php echo $meta['business_name'][0]; ?> Client Information </h3>
  97. <?php  global $wpdb;
  98.      $id = get_current_user_id();  
  99.     $clienttask_id1 = $wpdb->get_results( 'SELECT * FROM wpmw_users where user_client = 1 and current_client_user_id  ="'.$id.'" ');
  100.     ?><p style="float: left;    margin-top: 3px;   width: 15%;" class="another_clients" style= "text-align:center">Select Another Client:</p><?php echo $mebership_fam =  $_REQUEST['mst_field']; ?>
  101.    
  102.     <select name="task_field" class="task_field" style="border: 1px solid #ccc;box-shadow: 0 2px 1px 0 #ccc; height: 28px;
  103.     line-height: 28px; padding: 0 10px; margin-bottom:10px;">
  104.     <?php foreach($clienttask_id1 as $cid1){ print_r($cid);
  105.     $st_ligin1 =  $cid1->user_login;
  106.     $st_id1 = $cid1->ID;
  107.     $blw_id1 = preg_replace('/\s+/', '', $st_ligin1);
  108.      $str_uslogin1 = strtolower($blw_id1);
  109.     echo $mebership_fam =  $_REQUEST['task_field'];
  110.  
  111. ?>
  112.     <option id="<?php echo $st_id1; ?>" class="user" value="<?php echo $str_uslogin1;?>"<?php if ($str_uslogin1 == $_GET['member']) echo' selected="selected"'?> ><?php echo $str_uslogin1;?></option>
  113.  
  114.     <?php } ?>
  115. </select>
  116.  
  117. <input type="hidden" name="mst_field" value="<?php echo $str_uslogin1; ?>" id="mst_field" targetid="<?php echo $str_uslogin1; ?>">
  118. <?php echo $var = $_POST['mst_field'];?>
  119.    
  120.  
  121. <thead>
  122.     <tr><th class="tguide">Name of Guide Assigned</th>
  123.     <th class="templ">Employee Assigned to#</th>    
  124.     <th class="tass">Task Assigned</th>
  125.     <th class="tcomp">Task Completed</th>
  126.     <th class="task_proess"></th>
  127.     </tr>
  128.     </thead>  <tbody class="ui-sortable">
  129.    
  130.     <?php  global $wpdb;
  131.     if(isset($_POST["submit_project"]))
  132. {  
  133.     $sql_tasks = "update wpmw_assign_tasks set job_status='task_completed' where id= '$_REQUEST[cur_Id]'";
  134.     $query_tasks = mysql_query($sql_tasks);
  135.         if($query_tasks)
  136.         {
  137.             echo  '<p class="job">' ."Your Job Procedures has been completed Successfully" . '</p>';?>
  138.         <?php }
  139.         else {
  140.     echo mysql_error();
  141.     }
  142.  
  143. }
  144.     $_GET['member'];
  145.     $reg = $wpdb->get_results( "SELECT * FROM wpmw_assign_tasks where client_menu = '$_GET[member]'");
  146.     "SELECT * FROM wpmw_assign_tasks where client_menu = '$_GET[member]'";
  147.     foreach($reg as $register){
  148.     $job_id = $register->ID;
  149.     $task_id = $register->task_id;
  150.     $comp = $register->job_status;
  151.     $job_key = $register->job_key;
  152.     $_SESSION['$email_status'] = 0;
  153.     $bst_task = $register->task_menu;
  154.     $email_status = $register->email_status;
  155.     $user_mnu = preg_replace('/\s+/', '', $bst_task);
  156.     $cur_mnu = preg_replace('/\s+/', '%20', $bst_task);
  157.     $bst_name = $register->client_menu;
  158.     $user_name = preg_replace('/\s+/', '', $bst_name);
  159.     $cur_name = preg_replace('/\s+/', '%20', $bst_name);
  160.  
  161.     $bst_employee = $register->employee_menu;
  162.     $user_employee =preg_replace('/\s+/', '', $bst_employee);
  163.     $cur_employee =preg_replace('/\s+/', '%20', $bst_employee);
  164.     ?>
  165.     <tr class="ui-sortable-handle assisan_task">
  166.     <td class ="td-name" id= "user_mnu"><?php echo '<p>' .$user_mnu. '</p>'; ?> </td>
  167.     <td class ="td-name" id= "user_emol"><?php echo '<p>' .$user_employee. '</p>'; ?> </td>
  168.  
  169.     <td class ="td-name" style="text-align:center;"><?php if($comp == 'pending') { ?><div style="color:green;" class="<?php echo $comp; ?>">&#10003;</div>
  170. <?php }
  171.     if($comp == 'Registered'){ ?><div style="color:green;" class="<?php echo $comp; ?>">&#10003;</div><?php }
  172.     if($comp == 'task_completed') { ?><div style="color:green;" class="<?php echo $comp; ?>">&#10003;</div> <?php }?></td>
  173.  
  174.     <td class ="td-name" style="text-align:center;">
  175.     <?php
  176.     if($comp == 'pending') { ?><div class="<?php echo $comp; ?>">&#10008;</div><?php }
  177.     if($comp == 'Registered'){ ?><div id="rregister" class="<?php echo $comp; ?>">&bull;</div><?php }
  178.     if($comp == 'task_completed') { ?><div class="<?php echo $comp; ?>">&#10003;</div><?php }?>  </td>
  179.  
  180.     <style>
  181.     .pending{color: #FE3939; font-size: 22px; font-weight: bold; } .task_completed{color: green; font-size: 22px;
  182.     }.Registered {color: #ffcc00; font-size: 30px;} #rregister{color: #ffcc00; font-size: 80px;}
  183.     </style>
  184.  
  185.     <td class ="td-name"><form action="" method="POST">
  186.     <input type="submit" name="submit_email_data" class="submit_email_data" id="<?php echo $job_id; ?>"  
  187. value= "<?php if($email_status== 0) {echo 'Email Assistant Now'; }else {echo 'Resend to Assistant';} ?>">
  188.  
  189.  
  190.     <input type="hidden" id="cur_Id" name="cur_Id" value="<?php echo $job_id; ?>">
  191.     <input type="hidden" id="cur_value" task_menu ="<?php echo $cur_mnu; ?>" name="cur_value" value="<?php echo $cur_mnu; ?>">
  192.     <input type="hidden" id="cur_name" client_menu ="<?php echo $cur_name; ?>" name="cur_name" value="<?php echo $cur_name; ?>">
  193.     <input type="hidden" id="cur_employee" client_menu ="<?php echo $cur_employee; ?>" name="cur_employee" value="<?php echo  $cur_employee; ?>">
  194.         <?php  $_REQUEST['cur_name'];   ?>
  195.         </td>
  196.         <td class ="td-name">
  197.     <?php if($comp == 'pending') { ?> <input type="submit" name="submit_project_complete1" class="submit_project_complete" id="<?php echo $job_id; ?>"  value="Task Completed?" disabled/><?php }
  198.     if($comp == 'Registered'){ ?><input type="submit" name="submit_project" class="submit_project" id="<?php echo $job_id; ?>"  value="Task Completed?" enabled/><?php } ?>
  199.     <?php if($comp == 'task_completed'){ ?><input type="submit" name="submit_project_complete1" class="submit_project_complete" id="<?php echo $job_id; ?>"  value="Task Completed?" disabled/> <?php } ?>
  200. </form>
  201. </td>
  202.  
  203.         </tr>
  204.         <?php
  205. }
  206.  
  207.         $_REQUEST['cur_value'];
  208.         $msters = $wpdb->get_results("SELECT * FROM wpmw_tasklist where task_list = '$_REQUEST[cur_value]'") ;
  209.         "SELECT * FROM wpmw_tasklist where task_list = '$_REQUEST[cur_value]'";
  210.         //print_r($msters);
  211.         foreach($msters as $tt){
  212.         $tt->master_list; }
  213.  
  214.     if(isset($_REQUEST['submit_email_data'])){
  215.  
  216.     global $wpdb;
  217.     $email_status = "update wpmw_assign_tasks set email_status='1' where id= '$_REQUEST[cur_Id]'";
  218.     $query_status = mysql_query($email_status);
  219.  
  220.    
  221.         $employ_id1 = $wpdb->get_results( 'SELECT * FROM wpmw_users where user_login = "'.$_REQUEST['cur_employee'].'"');
  222.  
  223.         foreach($employ_id1 as $ww)
  224.         {
  225.             $curnt_id = $ww->ID;
  226.             $email_employ = $ww->user_email;
  227.             $to = $email_employ;
  228.         }
  229.                  $key = $wpdb->get_results( "SELECT * FROM wpmw_assign_tasks where id = '$_REQUEST[cur_Id]'");
  230.                  foreach($key as $frm)
  231.             {  
  232.                  $bst_key = $frm->job_key;  $frm_key = preg_replace('/\s+/', '', $bst_key);
  233.                  $re_id = $register->task_id;
  234.                  $master_menu1 =$register->master_menu;
  235.                  $subject = 'Notice of New Work '. "  " . $master_menu1 . "- " . $_REQUEST['cur_value'];
  236.             }              
  237.                      $message = ' Dear '. $_REQUEST['cur_employee']. "\r\n";
  238.                     $message .= "\r\n";
  239.                     $message .= 'I have some new work for you to complete. Please click on the link and complete the task using the information that has been provided to you'. "\r\n";
  240.                     $message .= "\r\n";
  241.                     $message .= 'http://www.seocheatguides.com/wp-admin/admin.php?page=Membership_dashborad%2Fmembership_dashboard.php%2Ftask-list&check=1&employee_menu='.$_REQUEST['cur_employee'].'&client_name='.$_REQUEST['cur_name'].'&ID='.$_REQUEST['cur_Id'].'&job_key='.$frm_key . "\r\n";
  242.  
  243.                     $message .= "\r\n";
  244.                     $message .= 'If you have any questions please email me at info@seocheatguides.com'. "\r\n";
  245.                     $message .= "\r\n";
  246.                     $message .= 'Thanks'. "\r\n";
  247.                     $message .=  $cur_tyg;
  248.                     $employ_id1= $wpdb->get_results( 'SELECT * FROM wpmw_users where user_login = "'.$_REQUEST['cur_employee'].'"');
  249.             foreach($employ_id1 as $ww)
  250.         {
  251.                     $curnt_id = $ww->ID;
  252.                     $email_employ = $ww->user_email;$header   =  $email_employ;}
  253.                     $header  .= "Cc:shrutisinghh77@gmail.com";
  254.                     $header  .= "MIME-Version: 1.0";
  255.                     $header  .= "Content-type: text/html";
  256.  
  257.                     $retval = mail ($to,$subject,$message,$header);
  258.     if( $retval == true ) {  
  259.     echo  '<p class="status_job" style="background: none repeat scroll 0 0 #52accc; color: red; font-size: 16px; margin-top: 10px;
  260.    text-align: center;">' ."Email has been sent successfully to your Assistant Account". '</p>';
  261.  
  262.     }
  263.     else {  echo '<p class="status_incomplete" style="background: none repeat scroll 0 0 #52accc; font-size: 16px; margin-top: 10px;
  264.    text-align: center;">' ."Email could not be sent...". '</p>';   exit;  }
  265.  
  266.     $message1 = 'http://www.seocheatguides.com/wp-admin/admin.php?page=Membership_dashborad%2Fmembership_dashboard.php%2Ftask-list&check=1&employee_menu='.$_REQUEST['cur_employee'].'&client_name='.$_REQUEST['cur_name'].'&ID='.$_REQUEST['cur_Id'].'&job_key='.$frm_key . "\r\n";
  267.     $_REQUEST['cur_Id'];
  268.     $email_url = "update wpmw_assign_tasks set email_url='$message1' where id= '$_REQUEST[cur_Id]'";
  269.     $query_url = mysql_query($email_url);
  270.  
  271.     }
  272.     ?>
  273.    
  274. </tbody></table><div class="modal_toggle">
  275. <button type="button" class="btn btn-info btn-lg" id = "myModal" data-toggle="modal" data-target="#myModal" name="new_task">Assign New Task</button>
  276. <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal1" name="modify_info">Modify Client Information</button>
  277.    
  278. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  279. <script>
  280. jQuery(document).ready(function(){
  281. jQuery("#update_submt").click(function(){
  282. jQuery("#verification").val("Verification");
  283. jQuery("#submit").val("submit");
  284. jQuery("#pleaseenteranytwodigits").val("14");
  285. jQuery("#fieldset").val("Fieldset");
  286. jQuery(".col-sm-9.modify_catch input").each(function() {
  287.  
  288. //jQuery(this).attr("required","required");
  289. });
  290. });
  291.  
  292.  
  293. jQuery("#myModal").click(function() {
  294. var url = 'http://www.seocheatguides.com/wp-admin/admin.php?page=Membership_dashborad%2Fmembership_dashboard.php%2Femployee';
  295. jQuery(location).attr('href', url);
  296. });
  297.  
  298.  
  299. jQuery(".modify_catch").append('<span class="pmpro_asterisk"> <abbr title="Required Field">*</abbr></span>');
  300.  
  301. if(!$(".shortcode_array").val()){
  302. $(".vfd_shortcode").css("display","block");
  303. }
  304.  
  305. });
  306.  
  307. </script>
  308. <?php
  309.       $dts = $wpdb->get_results("SELECT * FROM wpmw_users where user_login = '$_GET[member]'") ;
  310.        "SELECT * FROM wpmw_users where user_login = '$_GET[member]'";  
  311.       foreach($dts as $dt){ //print_r($dt);
  312.       $nce_id = $dt->ID;
  313.       $ncenme = $dt->user_nicename;
  314.       $user_id = $dt->ID;
  315.  
  316.     $meta = get_user_meta( $user_id );
  317.     $cl_name = $meta['client_name'][0];
  318.     $name = $meta['business_name'][0];
  319.     $adrs = $meta['address'][0];
  320.     $country = $meta['country'][0];
  321.     $state = $meta['state'][0];
  322.     $city = $meta['city'][0];
  323.     $code =  $meta['zip_code'][0];
  324.     $phn = $meta['phone_address'][0];
  325.     $url = $meta['url_address'][0];
  326.     $m_ail = $meta['reg_email'][0];
  327.     $des = $meta['business_description'][0];
  328.     $categoryu = $meta['business_category'][0];
  329.     $hoursform = $meta['hours_from'][0];
  330.     $hoursto = $meta['hours_to'][0];
  331.     $url_addresss = $meta['url_address'][0];
  332.     $gmail_website = $meta['gmail_url'][0];
  333.     $account = $meta['email_account'][0];
  334.     $pswd = $meta['gmail_password'][0];
  335.    
  336. if(isset($_POST['check_submit'])){
  337.  
  338.  
  339. $cl_name = $_POST['client_name'];
  340. $bus_name = $_POST['business_name'];
  341. $bus_address = $_POST['address'];
  342. $bus_country = $_POST['country'];
  343. $bus_state = $_POST['state'];
  344. $bus_city = $_POST['city'];
  345. $bus_zip = $_POST['zip_code'];
  346. $bus_phone = $_POST['phone_address'];
  347. $bus_url = $_POST['url_address'];
  348. $bus_mail = $_POST['email_account'];
  349. $bus_pswd = $_POST['gmail_password'];
  350. $mail_urll = $_POST['reg_email'];
  351. $des_url = $_POST['business_description'];
  352. $categoryu = $_POST['business_category'];
  353. $Hours_form = $_POST['hours_from'];
  354. $oper_hours = $_POST['hours_to'];
  355. $gmail_website = $_POST['gmail_url'];
  356.  
  357.  
  358.  update_user_meta( $nce_id, 'client_name', $cl_name);
  359.  update_user_meta( $nce_id, 'business_name', $bus_name);
  360.  update_user_meta( $nce_id, 'address', $bus_address);
  361.  update_user_meta( $nce_id, 'country', $bus_country);
  362.  update_user_meta( $nce_id, 'state', $bus_state);
  363.  update_user_meta( $nce_id, 'city', $bus_city);
  364.  update_user_meta( $nce_id, 'zip_code', $bus_zip);
  365.  update_user_meta( $nce_id, 'phone_address', $bus_phone);
  366.  update_user_meta( $nce_id, 'url_address', $bus_url);
  367.  update_user_meta( $nce_id, 'email_account',$bus_mail);
  368.  update_user_meta( $nce_id, 'gmail_password',$bus_pswd);
  369.  update_user_meta( $nce_id, 'reg_email', $mail_urll);
  370.  update_user_meta( $nce_id, 'business_description', $des_url);
  371.  update_user_meta( $nce_id, 'business_category', $categoryu);
  372.  update_user_meta( $nce_id, 'hours_from', $Hours_form);
  373.  update_user_meta( $nce_id, 'hours_to', $oper_hours);
  374.  update_user_meta( $nce_id, 'gmail_url', $gmail_website);
  375.  
  376.  
  377.     $array = array();
  378.     global $wpdb;
  379.     $id = get_current_user_id();
  380.     $tdat = $wpdb->get_row( "SELECT * FROM wpmw_visual_form_builder_entries where user_id = '$id' and client_user_id ='$nce_id'");
  381.  
  382. if(empty($tdat)){
  383.     $tdat = $wpdb->get_row( "SELECT * FROM wpmw_visual_form_builder_entries");
  384. }
  385.  
  386. //echo '<pre>'; print_r($tdat); echo '</pre>'; die;
  387.  
  388.    
  389.      $data_vis = $tdat->data;
  390.     $sun = unserialize($data_vis);
  391. //echo "<pre>";print_r($sun);echo "</pre>"; die;
  392. $act = serialize($_POST);
  393. $act_as = unserialize(strtolower($act));
  394. $output = array_slice($act_as, 17, 100, true);
  395. $act_ass = serialize($output);
  396. //echo "<pre>";print_r($act_as);echo "</pre>";  die;
  397. $newarr = array();
  398. foreach($sun as $key=>$val)
  399. {
  400.         $newval = $val;
  401. //if($_SESSION['newChange'] == 'false' ){
  402.         if(array_key_exists($val['slug'],$act_as))
  403.         {
  404.             $myslug = $val['slug'];
  405.             $newval['value'] = $act_as[$myslug];
  406.         }
  407. /*}else if($_SESSION['newChange'] == 'true' ){
  408.         if(array_key_exists($val['slug'],$act_as))
  409.         {
  410.             $myslug = $val['slug'];
  411.             $newval['value'] = $act_as[$myslug];
  412.         }
  413. }*/
  414.  
  415.         $newarr[$key] = $newval;
  416.  
  417. }
  418. //echo "<pre>";print_r($newarr);echo "</pre>"; die;
  419.         $new_serialize = serialize($newarr);
  420.  
  421. if($_SESSION['newChange'] == 'true' ){
  422.  $sql_bulider = "INSERT INTO wpmw_visual_form_builder_entries(data,user_id,client_user_id)VALUES('".$new_serialize."','".$id."','".$nce_id."')";
  423.  
  424. }else if($_SESSION['newChange'] == 'false' ){
  425.  
  426.     $sql_bulider = "UPDATE wpmw_visual_form_builder_entries SET data='$new_serialize ' where user_id = '$id' and client_user_id ='$nce_id'";
  427. }
  428.         $query_bulider = mysql_query($sql_bulider);
  429.         }
  430.         ?>
  431.     <script>
  432.     //var post_id = '<?php $update_meta ?>';
  433.     </script>
  434. <?php
  435.  
  436. } ?>
  437.  
  438.   <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  439.   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  440.   <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  441.     <div class="modal fade" id="myModal1" role="dialog">
  442.     <div class="modal-dialog">
  443.    
  444.       <!-- Modal content-->
  445.       <div class="modal-content">
  446.         <div class="modal-header">
  447.           <button type="button" class="close" data-dismiss="modal">&times;</button>
  448.           <h4 class="modal-title" style:"text-align:center;">Client Information Update:</h4>
  449.         </div>
  450.         <div class="modal-body">
  451.           <form class="form-horizontal business_class" id = "business_id"role="form" action="" method="POST">
  452.  
  453.     <div class="form-group">
  454.     <label class="control-label col-sm-2"  for="client_name">Client Name</label>
  455.     <div class="col-sm-9 modify_catch">
  456.     <input name="client_name" type="text" class="form-control cl-name" value="<?php echo(isset($meta['client_name'][0]) ? $meta['client_name'][0] : null); ?>" placeholder="Client Name" id="cl_name" />
  457.     </div>
  458.     </div>
  459.    
  460.     <div class="form-group">
  461.     <label class="control-label col-sm-2"  for="modify_name">Business Name</label>
  462.     <div class="col-sm-9 modify_catch">
  463.     <input name="business_name" type="text" class="form-control business-name" value="<?php echo(isset($meta['business_name'][0]) ? $meta['business_name'][0] : null); ?>" placeholder="Business Name" id="modify_name" />
  464.     </div>
  465.     </div>
  466.    
  467.     <div class="form-group">
  468.     <label class="control-label col-sm-2" for="modify_address">Business Address</label>
  469.     <div class="col-sm-9 modify_catch">
  470.     <input type="text" name="address" class="form-control business_address" value="<?php echo(isset($meta['address'][0]) ? $meta['address'][0] : null); ?>" id="modify_address" PLaceholder="Business Address" />
  471.     </div>
  472.     </div>
  473.  
  474.     <div class="form-group">
  475.     <label class="control-label col-sm-2" for="modify_country">Country</label>
  476.     <div class="col-sm-9 modify_catch">
  477.     <input type="text" name="country" class="form-control" value="<?php echo(isset($meta['country'][0]) ? $meta['country'][0] : null); ?>" id="modify_country" PLaceholder="Country"/>
  478.     </div>
  479.     </div>
  480.  
  481.     <div class="form-group">
  482.     <label class="control-label col-sm-2" for="modify_state">State/Province</label>
  483.     <div class="col-sm-9 modify_catch">
  484.     <input type="text" name="state" value="<?php echo(isset($meta['state'][0]) ? $meta['state'][0] : null); ?>" class="form-control bus_state" id="modify_state" PLaceholder="State/Province"/>
  485.     </div>
  486.     </div>
  487.  
  488.     <div class="form-group">
  489.     <label class="control-label col-sm-2" for="modify_city">City</label>
  490.     <div class="col-sm-9 modify_catch">
  491.     <input type="text" name="city" class="form-control business_city" value="<?php echo(isset($meta['city'][0]) ? $meta['city'][0] : null); ?>" id="modify_city" PLaceholder="Business City" />
  492.     </div>
  493.     </div>
  494.  
  495.  
  496.     <div class="form-group">
  497.     <label class="control-label col-sm-2" for="modify_zip">Zip/Postal Code</label>
  498.     <div class="col-sm-9 modify_catch">
  499.     <input type="text" name="zip_code" class="form-control" value="<?php echo(isset($meta['zip_code'][0]) ? $meta['zip_code'][0] : null); ?>" id="modify_zip" PLaceholder="Business Zip code"/>
  500.     </div>
  501.     </div>
  502.  
  503.     <div class="form-group">
  504.     <label class="control-label col-sm-2" for="modify_phone">Phone Number</label>
  505.     <div class="col-sm-9 modify_catch">
  506.     <input type="text" name="phone_address" class="form-control" value="<?php echo(isset($meta['phone_address'][0]) ? $meta['phone_address'][0] : null); ?>" id="modify_phone" placeholder="Phone Number"/>
  507.     </div>
  508.     </div>
  509.    
  510.     <div class="form-group">
  511.     <label class="control-label col-sm-2" for="mail_urll">Email</label>
  512.     <div class="col-sm-9 modify_catch">
  513.     <input type="text" name="reg_email" class="form-control" value="<?php echo(isset($meta['reg_email'][0]) ? $meta['reg_email'][0] : null); ?>" id="mail_urll"  placeholder="Email Url"/>
  514.     </div>
  515. </div>
  516.  
  517. <div class="form-group">
  518.     <label class="control-label col-sm-2" for="des_url">Business Description</label>
  519.     <div class="col-sm-9 modify_catch">
  520.     <input type="text" name="business_description" class="form-control" value="<?php echo(isset($meta['business_description'][0]) ? $meta['business_description'][0] : null); ?>" id="des_url"  placeholder="Description"/>
  521.     </div>
  522. </div>
  523.  
  524. <div class="form-group">
  525.     <label class="control-label col-sm-2" for="categoryu">Business Category</label>
  526.     <div class="col-sm-9 modify_catch">
  527.     <input type="text" name="business_category" class="form-control" value="<?php echo(isset($meta['business_category'][0]) ? $meta['business_category'][0] : null); ?>" id="categoryu"  placeholder="categoryu"/>
  528.     </div>
  529. </div> 
  530.  
  531. <div class="form-group">
  532.     <label class="control-label col-sm-2" for="Hours_Operation">Hours From</label>
  533.     <div class="col-sm-9 modify_catch">
  534.     <input type="text" name="hours_from" class="form-control" value="<?php echo(isset($meta['hours_from'][0]) ? $meta['hours_from'][0] : null); ?>" id="Hours_Operation"  placeholder="Hours"/>
  535.     </div>
  536. </div>
  537.  
  538. <div class="form-group">
  539.     <label class="control-label col-sm-2" for="oper_hours">Hours To</label>
  540.     <div class="col-sm-9 modify_catch">
  541.     <input type="text" name="hours_to" class="form-control" value="<?php echo(isset($meta['hours_to'][0]) ? $meta['hours_to'][0] : null); ?>" id="oper_hours"  placeholder="Hours"/>
  542.     </div>
  543. </div>
  544.  
  545.     <div class="form-group">
  546.     <label class="control-label col-sm-2" for="modify_url">Website Url</label>
  547.     <div class="col-sm-9 modify_catch">
  548.     <input type="text" name="url_address" class="form-control" value="<?php echo(isset($meta['url_address'][0]) ? $meta['url_address'][0] : null); ?>" id="modify_url"  placeholder="website Url"/>
  549.     </div>
  550. </div>
  551.  
  552. <h3> Gmail Information </h3>
  553.  
  554. <div class="form-group">
  555.     <label class="control-label col-sm-2" for="modify_gmail">Gmail Email</label>
  556.     <div class="col-sm-9 modify_catch">
  557.     <input type="text" name="email_account" class="form-control" value="<?php echo(isset( $meta['email_account'][0]) ?  $meta['email_account'][0] : null); ?>" id="modify_gmail" placeholder="Gmail"/>
  558.     </div>
  559.     </div>
  560.  
  561.     <div class="form-group">
  562.     <label class="control-label col-sm-2" for="modify_password">Gmail Password</label>
  563.     <div class="col-sm-9 modify_catch">
  564.     <input type="password" name="gmail_password" class="form-control" value="<?php echo(isset( $meta['gmail_password'][0]) ?  $meta['gmail_password'][0] : null); ?>" id="modify_password"  placeholder="Password"/>
  565.     </div>
  566.     </div>
  567.    
  568.     <div class="form-group">
  569.     <label class="control-label col-sm-2" for="gmail_url">Website Url</label>
  570.     <div class="col-sm-9 modify_catch">
  571.     <input type="text" name="gmail_url" class="form-control" value="<?php echo(isset( $meta['gmail_url'][0]) ?  $meta['gmail_url'][0] : null); ?>" id="gmail_urll"  placeholder="gmail_url"/>
  572.     </div>
  573. </div>
  574.  
  575. <?php
  576.  
  577.     global $wpdb;
  578.     $id = get_current_user_id();
  579.     $tdat = $wpdb->get_results( "SELECT * FROM wpmw_visual_form_builder_entries where user_id = '$id' and client_user_id ='$nce_id'");
  580.  
  581.         if(isset($tdat) && !empty($tdat))
  582.         {
  583.         $_SESSION['newChange'] = 'false';
  584.  
  585.         $array = array();
  586.         foreach($tdat as $ddd)
  587.         {
  588.         $data_vis = $ddd->data;
  589.         $sun = unserialize($data_vis);
  590.  
  591.         $arrlength = count($sun);
  592.  
  593.         foreach($sun as $row)
  594.          {
  595.          ?>
  596.         <div class="form-group important_field <?php echo $row['name']; ?>">
  597.         <label class="control-label col-sm-2" for="<?php echo $row['name']; ?>"><?php echo $row['slug']; ?></label>
  598.         <div class="col-sm-9 modify_catch">
  599.         <input type="text" slug ="<?php echo $row['slug']; ?>" name="<?php echo $row['slug']; ?>" class="form-control" value="<?php             echo ( $row['value']) ?  $row['value'] : ''; ?>" id="<?php echo strtolower(preg_replace('/\s+/', '',$row['name'])); ?>" Placeholder="<?php echo $row['name']; ?>"/>
  600.         </div>
  601.         </div>
  602.  
  603.     <?php  
  604.  
  605.  
  606.     }
  607.     }
  608. }else{
  609.  
  610. $_SESSION['newChange'] = 'true';
  611.  
  612. // if user has no entries
  613. $tdat = $wpdb->get_row( "SELECT * FROM wpmw_visual_form_builder_entries");
  614.  
  615.  
  616.         $data_vis = $tdat->data;
  617.         $sun = unserialize($data_vis);
  618.  
  619.         foreach($sun as $row)
  620.          {
  621.      ?>
  622.  
  623.         <div class="form-group important_field <?php echo $row['slug']; ?>">
  624.         <label class="control-label col-sm-2" for="<?php echo $row['slug']; ?>"><?php echo $row['name']; ?></label>
  625.         <div class="col-sm-9 modify_catch">
  626.         <input type="text" slug ="<?php echo $row['slug']; ?>" name="<?php echo $row['slug']; ?>" class="form-control" value="<?php             echo ''; ?>" id="<?php echo strtolower(preg_replace('/\s+/', '',$row['name'])); ?>" Placeholder="<?php echo $row['name']; ?>"/>
  627.         </div>
  628.         </div>
  629.  
  630.     <?php  
  631.         }
  632.  
  633. }
  634.  
  635. ?>
  636.  
  637.  
  638.  
  639.  
  640. <div class="form-group">
  641.     <div class="col-sm-offset-2 col-sm-10">
  642.     <input type="submit" class="btn btn-default" name="check_submit" value="Submit" id="update_submt"/>
  643.     </div>
  644.     </div>
  645.    
  646.    
  647.    
  648. </form>
  649.         </div>
  650.         <div class="modal-footer">
  651.           <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  652.         </div>
  653.       </div>
  654.   </div>
  655.   </div>
  656. <style>
  657. .modify_catch input {
  658.     float: left;
  659.     margin: 0 0 0 30px;
  660.     width: 90%;
  661. }
  662. .pmpro_asterisk {
  663.     float: right;
  664.     width: auto;
  665. }
  666. .modify_catch input {
  667.     float: left;
  668.     margin: 0 0 0 30px;
  669.     width: 90%;
  670. }
  671. .form-group.Fieldset {
  672.     display: none;
  673. }
  674. .form-control {
  675.     margin-left: 30px;
  676. }
  677. .form-group.Please.enter.any.two.digits{
  678.     display: none;
  679. }
  680. .form-group.Submit{
  681.     display:none;
  682. }
  683. .form-group.Verification{
  684.     display:none;
  685. }
  686. .btn-group-lg > .btn, .btn-lg {
  687.     border-radius: 6px;
  688.     font-size: 16px;
  689.     line-height: 1.33333;
  690.     margin: 19px 0 0;
  691.     padding: 10px 16px;
  692. }
  693. </style>   
  694.     <?php
  695.  
  696. }
  697.  
  698.  
  699. /*************** DASHBORAD *******************/
  700. function membership_pro_init(){?>
  701.  
  702. <div id="wpbody" role="main">
  703. <div id="wpbody-content" tabindex="0" aria-label="Main content" style="overflow: hidden;">
  704.  
  705. <div id="dashboard-widgets-wrap">
  706. <div id="dashboard-widgets" class="metabox-holder">
  707. <div id="postbox-container-1" class="postbox-container">
  708. <div id="normal-sortables" class="meta-box-sortables ui-sortable">
  709. <div id="dashboard_activity" class="postbox ">
  710. <button class="handlediv button-link" aria-expanded="true" type="button">
  711. <span class="screen-reader-text">Toggle panel: Activity</span>
  712. <span class="toggle-indicator" aria-hidden="true"></span>
  713. </button>
  714. <h2 class="hndle ui-sortable-handle"><span>CLIENT SUMMARY:</span></h2>
  715. <div class="inside">
  716. <div id="activity-widget">
  717. <div class="activity-block" id="published-posts">
  718. <table class="widefat membership-levels" id="table-name" BORDER="1" WIDTH="40%" CELLSPACING="3">
  719. <h3 style= "text-align:center">Client Data:</h3>
  720.  
  721. <thead>
  722.  <tr><th rowspan="2" style="text-align:center" >Client Names</th>
  723. <th style="text-align:center" colspan="3"> Guides </th><tr>
  724. <th valign="top">Assigned</th>
  725. <th>Checked-in</th>
  726. <th>%Completed</th></tr>
  727.  
  728.  
  729.     </thead>  <tbody class="ui-sortable">
  730.     <tr class="ui-sortable-handle" id = "processing">
  731.  
  732.  
  733.  
  734.     <td id="select_name" class="task_chnge" onchange= "taskprocessing(this.value)" style="line-height:2.5em;" value="<?php echo $tid; ?>" stp_id = "<?php echo $sd; ?>">
  735.  
  736.     <?php global $wpdb;  $id = get_current_user_id();  
  737.     $clienttask_id = $wpdb->get_results( 'SELECT * FROM wpmw_users where user_client = 1 and current_client_user_id  ="'.$id.'" ORDER BY user_login ASC');
  738.     //print_r($clienttask_id);  
  739.     foreach($clienttask_id as $cid){
  740.     $sd = $cid->ID;  
  741.     $tid = preg_replace('/\s+/', '', $cid->user_login);?>
  742.     <p tp_id = "before<?php echo $sd; ?>" class="tid" style="cursor: pointer;" artcileid ="<?php echo $tid; ?>"><?php echo $tid; ?>
  743.     </p>
  744.  
  745.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  746.     <script>
  747.     jQuery(document).ready(function(){
  748.         jQuery(".tid").click(function() {
  749.             var datae = jQuery(this).attr('artcileid');
  750.             var url = 'http://www.seocheatguides.com/wp-admin/admin.php?page=Membership_dashborad%2Fmembership_dashboard.php%2Fregistered_clients&member=' + datae;
  751.             jQuery(location).attr('href', url);
  752.         });
  753.     });
  754. </script>
  755.  
  756. <?php
  757. }
  758.     ?></td>
  759.  
  760.     <td name="task_name" style="line-height:2.5em;" value="<?php echo $tid; ?>">
  761.     <?php foreach($clienttask_id as $cid){
  762.     $query = mysql_query('SELECT * FROM wpmw_assign_tasks where client_menu = "'.$cid->user_login.'"');
  763.     'SELECT * FROM wpmw_assign_tasks where client_menu = "'.$cid->user_login.'"';
  764.     $number = mysql_num_rows($query);
  765.     echo '<p>' .$number. '</p>'; } ?>
  766.     </td>
  767.    
  768.     <td name="hndle" style="line-height:2.5em;">
  769.     <?php foreach($clienttask_id as $cid){  
  770.     $i = mysql_query('SELECT * FROM wpmw_assign_tasks where job_status = "task_completed" and client_menu = "'.$cid->user_login.'"');
  771.     //echo 'SELECT * FROM wpmw_assign_tasks where job_status = "complete" and client_menu = "'.$cid->user_login.'"';
  772.     $num = mysql_num_rows($i);  
  773.     echo '<p>' .$num. '</p>';
  774.     }
  775.     ?>
  776.     </td>
  777.  
  778.     <td><?php foreach($clienttask_id as $cid){
  779.     $query = mysql_query('SELECT * FROM wpmw_assign_tasks where client_menu = "'.$cid->user_login.'"');
  780.     $number = mysql_num_rows($query);
  781.     '<p>' .$number. '</p>';
  782.     $i = mysql_query('SELECT * FROM wpmw_assign_tasks where job_status = "task_completed" and client_menu = "'.$cid->user_login.'"');
  783.     $num = mysql_num_rows($i);  
  784.     '<p>' .$num. '</p>';
  785.  
  786.     $percentage= $num/$number * 100;
  787.     echo '<p>' .$res = round($percentage). ' % ' . '</p>'; }
  788.  ?> </td>
  789.     </tr>
  790.     </tbody></table>
  791.     </div></div></div></div></div></div>
  792.  
  793.  
  794. <div id="postbox-container-2" class="postbox-container">
  795. <div id="side-sortables" class="meta-box-sortables ui-sortable">
  796. <div id="dashboard_primary" class="postbox ">
  797. <button class="handlediv button-link" aria-expanded="true" type="button">
  798. <span class="screen-reader-text">Toggle panel: Employee Information</span>
  799. <span class="toggle-indicator" aria-hidden="true"></span>
  800. </button>
  801. <h2 class="hndle ui-sortable-handle">
  802. <span>Assistant Summary:</span>
  803. </h2>
  804. <div class="inside1">
  805. <div id="activity-widget">
  806. <div class="activity-block" id="published-posts">
  807. <table class="widefat membership-levels" id="table-name" BORDER="1" WIDTH="50%" CELLSPACING="2">
  808. <h3 style= "text-align:center;">Assistant Data:</h3>
  809. <thead><tr>
  810. <tr><th >Assistant Name</th>
  811. <th>Assistant Email</th>
  812. <th style=" height: 26px; width: 213px;">Comments</th></tr>
  813.  
  814.  
  815. </thead>  
  816. <tbody class="member_emp ui-sortable">
  817.    
  818.    
  819.     <?php $id = get_current_user_id();
  820.     $employ_id = $wpdb->get_results( 'SELECT * FROM wpmw_users where user_employee = 1 and current_employee_user_id ="'.$id.'" ');
  821.  
  822.      foreach($employ_id as $emp) { ?>
  823.     <tr class="ui-sortable-handle" id ="member_emp">
  824.     <?php  $str_id = $emp->ID; ?>
  825.     <td><?php echo '<a href="http://www.seocheatguides.com/wp-admin/admin.php?page=Membership_dashborad%2Fmembership_dashboard.php%2Fassign-tasks" class ="str">'. $emp->user_nicename .'</a>' ; ?></td>
  826.     <td><?php  echo $emp->user_email; ?></td>
  827.     <td class="commentss_meta">
  828.     <?php $meta = get_user_meta( $str_id );
  829.     echo $meta['employee_comment'][0];?>
  830.     </td>
  831.     </tr>
  832.     <?php } ?>
  833. </tbody>
  834. </table>
  835. </div>
  836. </div>
  837. </div>
  838. </div>
  839. </div>
  840. </div>
  841.  
  842.  
  843.  
  844. <div id="postbox-container-3" class="postbox-container">
  845. <div id="side-sortables" class="meta-box-sortables ui-sortable">
  846. <div id="dashboard_primary1" class="postbox ">
  847. <h2 class="hndle ui-sortable-handle">
  848.     <!--span>Task Information:</span-->
  849. <div class="dta" style="display:none"></div>
  850. </h2>
  851. <div class="inside1">
  852. <div id="activity-widget">
  853. <div class="activity-block" id="published-posts">
  854. <div class="header">
  855. <!--h3 style= "text-align:center;">Task Data:</h3-->
  856. </div>
  857.  
  858. <div class="select_client"></div>
  859.  
  860. </div></div></div></div></div></div>
  861. </div></div></div></div>
  862. <style>
  863. .head_sec {float:left; width:100%;}
  864. .head_sec div {
  865.   float: left;
  866.   padding: 9px 7px;
  867.   width: 30%;
  868.   text-align: center;
  869.   background: #fff;
  870.   border: 1px solid;
  871. }
  872. #dashboard_primary1 {
  873.     display: none;
  874. }
  875.  
  876. .body_sec {float:left; width:100%;}
  877. .body_sec div {
  878.   float: left;
  879.   padding: 9px 7px;
  880.   width: 30%;
  881.   text-align: center;
  882.   background: #fff;
  883.   border: 1px solid;
  884. }
  885. #select_name .tid:hover {color: #0073aa;font-size: 14px;}
  886. .str {color: #32373c;}
  887. .commentss_meta{word-break:break-all;}
  888.  
  889. .job {
  890.     font-size: 20px;
  891. }
  892. </style>
  893.  
  894.  
  895. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  896. <script>
  897. jQuery(document).ready(function(){
  898. jQuery(".handlediv").click(function(){        
  899. jQuery(".inside").slideToggle();
  900. });
  901.  
  902. /*
  903. jQuery(".tid").on("click", function(){
  904. jQuery(".dta").html('');
  905. jQuery(".member_emp").html('');
  906. jQuery(".select_client").html('');
  907. //alert($(this).text());
  908. var member = jQuery(this).text();
  909. //alert(member);
  910. jQuery.ajax({
  911.     type:'POST',
  912.     url:'http://www.seocheatguides.com/wp-content/plugins/Membership_dashborad/employee_task.php',
  913.     data:"member="+member,
  914.  
  915.    success: function(result){
  916. //alert(data);
  917. jQuery(".dta").html('<table>'+result+'</table>');
  918. jQuery(".member_emp").html(jQuery(".dta table tbody ").html());
  919. var all = $(".scl").map(function() {
  920.     return this.innerHTML;
  921. }).get();
  922.  
  923. console.log(all.join());
  924. jQuery(".body_sec").html(all);
  925.         //alert(result);
  926. }
  927. });*/
  928.     });
  929. });
  930.  
  931.  
  932. </script>
  933. <?php
  934. }
  935.  
  936. /***********************     Task List ********************/
  937.  
  938.  
  939. function clivern_task_list_page(){
  940.  
  941.     $user_role = array_shift(wp_get_current_user()->roles);
  942.     $check =$_GET['check'];
  943.     $user_role;
  944.     $_SESSION['role'] = $user_role;
  945.     if($check == 1 && $user_role == 'subscriber' || $check == 1 && $user_role == 'contributor' || $check == 1 && $user_role == 'administrator')
  946.     {
  947.  wp_redirect( 'http://www.seocheatguides.com/wp-login.php' );
  948.     wp_logout();
  949. ?>
  950. <script>
  951. jQuery(document).ready(function(){
  952.  window.location.reload();
  953.         return false;
  954. });
  955. </script>
  956. <?php
  957.  
  958. }
  959. else if($user_role == 'subscriber'){?>
  960.     <table class="widefat membership-levels" style="width: 60%;">
  961.     <thead>
  962.     <tr><th class="tsk_mnu">Task#</th> <th class="tsk_mnu">MasterTask</th>   <th class="tsk_mnu">Task List</th>
  963.     <style>
  964.     .tsk_lst{width:50%;}
  965.     .tsk_mnu {
  966.     background: none repeat scroll 0 0 #0073aa;
  967.     color: #fff !important;   width: 15%;
  968.     }</style>
  969.     </tr>
  970.     </thead>  <tbody class="ui-sortable">
  971.     <tr class="ui-sortable-handle">
  972.     <td style="line-height: 2em;"><?php global $wpdb;
  973.     $user_count = $wpdb->get_var( "SELECT COUNT(*) FROM wpmw_tasklist" );
  974.     for( $x = 1; $x < $user_count; $x++ ){
  975.     echo '<p>'. $x. '</p>';
  976.     }?></td>
  977.     <td style="line-height: 2em;">
  978.     <?php
  979.     $usermeta_tasklist = $wpdb->get_results( 'select * from wpmw_tasklist ORDER BY master_list ASC');
  980.     //$id = get_current_user_id();
  981.     foreach($usermeta_tasklist as $result_tasklist){  //print_r($result_tasklist);?>
  982.     <?php echo $result_tasklist->master_list ." <br> "; ?>
  983.     <?php  }  ?>
  984.     </td>
  985.     <td style="line-height: 2em;">  <?php $usermeta_tasklist = $wpdb->get_results( 'select * from wpmw_tasklist');
  986.     //$id = get_current_user_id();
  987.     foreach($usermeta_tasklist as $result_tasklist){  //print_r($result_tasklist);?>
  988.     <?php echo $result_tasklist->task_list ." <br> "; }?></td>
  989.     </tr>
  990.     </tbody>
  991.     </table>
  992.     <?php
  993. }
  994.  
  995. else if($user_role == 'contributor'){ ?>
  996.     <table class="widefat membership-levels" style="width: 40%;">
  997.     <thead>
  998.     <tr><th class="tsk_mnu">Task#</th> <th class="tsk_mnu">MasterTask</th>   <th class="tsk_mnu">Task List</th>
  999.     <style>
  1000.     .tsk_lst{width:50%;}
  1001.     .tsk_mnu {
  1002.     background: none repeat scroll 0 0 #0073aa;
  1003.     color: #fff !important;   width: 15%;
  1004.     }</style>
  1005.     </tr>
  1006.     </thead>  <tbody class="ui-sortable">
  1007.     <tr class="ui-sortable-handle">
  1008.     <td style="line-height: 2em;"><?php global $wpdb;
  1009.     $user_count = $wpdb->get_var( "SELECT COUNT(*) FROM wpmw_tasklist" );
  1010.     for( $x = 1; $x < $user_count; $x++ ){
  1011.     echo '<p>'. $x. '</p>';
  1012.     }?></td>
  1013.     <td style="line-height: 2em;">
  1014.     <?php
  1015.     $usermeta_tasklist = $wpdb->get_results( 'select * from wpmw_tasklist ORDER BY master_list ASC');
  1016.     //$id = get_current_user_id();
  1017.     foreach($usermeta_tasklist as $result_tasklist){  //print_r($result_tasklist);?>
  1018.     <?php echo $result_tasklist->master_list ." <br> "; ?>
  1019.     <?php  }  ?>
  1020.     </td>
  1021.     <td style="line-height: 2em;">  <?php $usermeta_tasklist = $wpdb->get_results( 'select * from wpmw_tasklist');
  1022.     //$id = get_current_user_id();
  1023.     foreach($usermeta_tasklist as $result_tasklist){  //print_r($result_tasklist);?>
  1024.     <?php echo $result_tasklist->task_list ." <br> "; }?></td>
  1025.     </tr>
  1026.     </tbody>
  1027.     </table>
  1028.     <?php
  1029. }
  1030. else if($user_role == 'administrator')
  1031.  {
  1032.  
  1033. ?>
  1034. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  1035. <script>
  1036. jQuery(document).ready(function(){
  1037. jQuery("#task_submit").click(function(){
  1038.  
  1039. var master_check = jQuery('#master_check').val();
  1040. if(master_check==""){
  1041. jQuery("#master_check").css("border-color" , "red");
  1042. jQuery("#master_check").focus();
  1043. return false;
  1044. }
  1045. else
  1046. {  
  1047. jQuery("#master_check").css("border-color", "#dadada");
  1048. }
  1049.  
  1050.  
  1051. var task_id =jQuery('#task_name').val();
  1052. if(task_id==""){
  1053. jQuery("#task_name").css("border-color" , "red");
  1054. jQuery("#task_name").focus();
  1055. return false;
  1056. }
  1057. else
  1058. {  
  1059. jQuery("#task_name").css("border-color", "#dadada");
  1060. }
  1061. });
  1062. });
  1063.     </script>
  1064.     <table class="widefat membership-levels" style="width: 100%;">
  1065.     <thead>
  1066.     <tr><th class="tsk_lst">Task List Form</th> <th class="tsk_mnu" style="width:15%;">Task#</th> <th style="width:19%;" class="tsk_mnu">MasterTask</th>   <th class="tsk_mnu">Task List</th>
  1067. <style>
  1068.     .tsk_lst{width:35%;}
  1069.  
  1070.     #wpbody-content > p {
  1071.     font-size: 18px;
  1072.     font-weight: normal;
  1073.     }
  1074.     .tsk_mnu {
  1075.     background: none repeat scroll 0 0 #0073aa;
  1076.     color: #fff !important;   width: 15%;
  1077.     }
  1078.  
  1079.     #task_submit {
  1080.         font-size: 15px;
  1081.         margin-left: 10px;
  1082. }
  1083. </style>
  1084.     </tr>
  1085.     </thead>  <tbody class="ui-sortable">
  1086.     <tr class="ui-sortable-handle">
  1087.     <td><form action="" method="POST">
  1088.     <div class="form-group">
  1089.     <label class="control-label col-sm-2" for="master_task">Master Task:</label>
  1090.     <div class="col-sm-7">
  1091.     <input type="text" id="master_check" name="master" Placeholder ="Enter Your Master list">
  1092.     </div></div>       
  1093.    
  1094.     <div class="form-group">
  1095.     <label class="control-label col-sm-2" for="associated_task">Associated Guide:</label>
  1096.     <div class="col-sm-7">
  1097.     <input type="text" id="task_name" name="check_list" Placeholder ="Enter Your Task list">
  1098.     </div></div>
  1099.  
  1100.     <!--div class="form-group">
  1101.     <label class="control-label col-sm-2" for="file_upload">Upload Guide file:</label>
  1102.     <div class="col-sm-7">
  1103.     <input type="file" name="file_upload" class="form-control" id="file_guide"/>
  1104.     </div>
  1105.     </div-->
  1106.  
  1107.     <div class="form-group" style=" margin-left: 0;">
  1108.     <div class="col-sm-offset-2 col-sm-10">
  1109.     <input type="submit" name="task_submit" id ="task_submit" Value="Submit" class= "button-primary">
  1110.     </div></div>   
  1111.     </form>
  1112.  
  1113.     </td>
  1114.     <td style="line-height: 2em;"><?php global $wpdb;
  1115.     $user_count = $wpdb->get_var( "SELECT COUNT(*) FROM wpmw_tasklist" );
  1116.     for( $x = 1; $x < $user_count; $x++ ){
  1117.     echo '<p>'. $x. '</p>';
  1118.     }?></td>
  1119.     <td style="line-height: 2em;">
  1120.     <?php
  1121.     $usermeta_tasklist = $wpdb->get_results( 'select * from wpmw_tasklist');
  1122.     //$id = get_current_user_id();
  1123.     foreach($usermeta_tasklist as $result_tasklist){  //print_r($result_tasklist);?>
  1124.     <?php echo $result_tasklist->master_list ." <br> "; ?>
  1125.     <?php  }  ?>
  1126.     </td>
  1127.     <td style="line-height: 2em;">  <?php $usermeta_tasklist = $wpdb->get_results( 'select * from wpmw_tasklist');
  1128.     //$id = get_current_user_id();
  1129.     foreach($usermeta_tasklist as $result_tasklist){  //print_r($result_tasklist);?>
  1130.     <?php echo $result_tasklist->task_list ." <br> "; }?></td>
  1131.     </tr>
  1132.     </tbody>
  1133.     </table>
  1134.  
  1135. <?php
  1136. if(isset($_REQUEST['task_submit']))
  1137. {
  1138.     $master = $_POST['master'];
  1139.     $check_list  =  $_POST['check_list'];
  1140.     global $wpdb;
  1141.     $id = get_current_user_id(); // current user id with tasklist
  1142.     $select_task = "select * from wpmw_users order by id desc limit 0,1";
  1143.     $query_task =  mysql_query($select_task);
  1144.     $fetch_task = mysql_fetch_array($query_task);
  1145.     $utask_id = $fetch_task["ID"]; // add client id with tasklist
  1146.  
  1147.     $wpdb->query('Insert into wpmw_tasklist (master_list,task_list,client_id,user_id) values("'.$master.'","'.trim( strip_tags( stripslashes($check_list))).'","'.$utask_id.'","'.$id.'")');
  1148.     $employee_data = 'Insert into wpmw_tasklist (master_list,task_list,client_id,user_id) values("'.$master.'","'.trim( strip_tags( stripslashes($check_list))).'","'.$utask_id.'","'.$id.'")';
  1149.     if( $employee_data ){
  1150.     echo '<p> Task List has been inserted </p>';
  1151.     }else{
  1152.     echo "Insertion failed, Try again..";
  1153.     }
  1154.  
  1155.     }
  1156. ?>
  1157. <?php
  1158. }
  1159.     else if($user_role == 'file_manager')
  1160. {
  1161. ?>
  1162. <div id="postbox-container-2" class="postbox-container">
  1163. <div id="side-sortables" class="meta-box-sortables ui-sortable">
  1164. <div id="dashboard_primary" class="postbox ">
  1165. <button class="handlediv button-link" aria-expanded="true" type="button">
  1166. <span class="screen-reader-text">Toggle panel: Task List Infomation</span>
  1167. <span class="toggle-indicator" aria-hidden="true"></span>
  1168. </button>
  1169. <h2 class="hndle ui-sortable-handle">
  1170.     <span>Task List Summary:</span>
  1171. </h2>
  1172. <div class="inside1">
  1173. <div id="activity-widget">
  1174. <div class="activity-block" id="published-posts">
  1175. <table class="widefat membership-levels" id="table-name" BORDER="1" WIDTH="100%" CELLSPACING="2">
  1176. <h3 style= "text-align:center;">Assistant Data:</h3>
  1177. <thead>
  1178. <tr>
  1179. <th>Assistant Client</th>
  1180. <th>Assistant Name</th>
  1181. <th>Assistant Task List</th>
  1182. <th>Assistant Job Approved Button</th>
  1183. </tr>
  1184.  
  1185. </thead>  <tbody class="member_emp ui-sortable">
  1186.    
  1187. <?php
  1188.     $id = get_current_user_id();
  1189.     global $wpdb;
  1190.     $employee_users = $_GET['employee_menu'];
  1191.     $iduser = $_GET['ID'];
  1192.     $tsk_mbr = $wpdb->get_results( 'SELECT * FROM wpmw_users where ID = "'.$id.'" ');
  1193.     //echo 'SELECT * FROM wpmw_users where ID = "'.$id.'" ';
  1194.     foreach($tsk_mbr as $emu)
  1195.     {
  1196.         $emu->user_login;
  1197.         $emu_id = $emu->current_employee_user_id;
  1198.         $get_member = $wpdb->get_results( "SELECT * FROM wpmw_users where ID = '$emu_id'");
  1199.         foreach($get_member as $get_member2){
  1200.         $to= $get_member2->user_email;
  1201.         }
  1202.  
  1203.  
  1204.         $ddd = $wpdb->get_results( "SELECT * FROM wpmw_assign_tasks where employee_menu = '$employee_users'");
  1205.         //echo "SELECT * FROM wpmw_assign_tasks where employee_menu = '$employee_users'";
  1206.         //echo "<pre>"; print_r($ddd);
  1207.         foreach($ddd as $txt){
  1208.         $txt_ID =  $txt->ID;    
  1209.         $job_key_employee = $txt->job_key;
  1210.         $complete_status = $txt->job_status;
  1211.         ?>
  1212.         <tr class="ui-sortable-handle">
  1213.         <td><?php echo '<p>'. $txt->client_menu .'</p>'; ?></td>       
  1214.         <td><?php echo '<p>'. $txt->employee_menu; '</p>';  ?> </td>
  1215.         <td><?php echo '<p>'. $txt->task_menu; '</p>';  ?></td>
  1216.         <td>
  1217.  
  1218.     <form action="" method="POST">
  1219.     <?php if($complete_status == 'pending'){ ?>
  1220.     <input type="button" name="approved_data" class="approved_data" id="<?php echo $txt->ID; ?>" value="Job Completed" enabled/>
  1221.     <?php
  1222.     }
  1223.         if($complete_status == 'Registered')
  1224.     {
  1225.         ?><input type="button" name="approved_data" class="approved_data" id="<?php echo $txt->ID; ?>" value="Job Completed" disabled/>
  1226.         <div id="successMessage" style="display:none;">Your Job Procedure has been completed</div>
  1227.         <?php
  1228.     }
  1229. if($complete_status == 'task_completed')
  1230.     {
  1231.         ?><input type="button" name="approved_data" class="approved_data" id="<?php echo $txt->ID; ?>" value="Job Completed" disabled/>
  1232.         <?php
  1233.     }
  1234.     ?>
  1235.     <input type="hidden" id="curnt_Id" name="curnt_Id" value="<?php echo $txt->ID; ?>"/>
  1236.     <input type="hidden" id="jobkey_Id" name="jobkey_Id" jobkey_Id="<?php echo $job_key_employee; ?>"/>
  1237.        
  1238.        
  1239.     </form></td></tr>
  1240. <?php
  1241. }
  1242. }
  1243. ?>
  1244. </tbody></table></div></div></div></div></div></div>
  1245. <?php
  1246. }
  1247. ?>
  1248. <script>
  1249. jQuery(document).ready(function(){
  1250.  
  1251.     jQuery(".approved_data").click(function(){
  1252. //jQuery(".approved_data").attr('disabled','disabled');
  1253. //jQuery("#successMessage").css("display","block");
  1254.         var curnt_Id = jQuery(this).attr('id');
  1255.         jQuery("#curnt_Id").val(curnt_Id);
  1256.             jQuery.ajax({
  1257.             type:'POST',
  1258.             url:'http://www.seocheatguides.com/wp-content/plugins/Membership_dashborad/job_updated.php',
  1259.             data:"curnt_Id="+curnt_Id,
  1260.                 success: function(data){
  1261.                 alert("Your Job Procedure has been completed");
  1262.                  $(this).attr('disabled', disabled);
  1263.             }
  1264.        
  1265.         });
  1266.  
  1267.     });
  1268.  
  1269.  
  1270. });
  1271. </script>
  1272.  
  1273.  
  1274. <?php
  1275. }
  1276.  
  1277. /******** for Assign List details *********/
  1278.  
  1279. function clivern_assign_list_page(){
  1280. ?>
  1281. <script>
  1282. /**** for clienttask details***/
  1283. /*
  1284. function clienttasklist(str)
  1285. {
  1286. if (str=="")
  1287. { edit
  1288.  
  1289. document.getElementById("client_wrap").innerHTML="";
  1290. return;
  1291. }
  1292. else {
  1293.         if (window.XMLHttpRequest) {
  1294.             // code for IE7+, Firefox, Chrome, Opera, Safari
  1295.             xmlhttp = new XMLHttpRequest();
  1296.         } else {
  1297.             // code for IE6, IE5
  1298.             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  1299.         }
  1300.  
  1301.  
  1302. xmlhttp.onreadystatechange=function()
  1303. {
  1304. if (xmlhttp.readyState==4 && xmlhttp.status==200)
  1305. {
  1306.    console.log(xmlhttp.responseText);
  1307. var result = JSON.parse(xmlhttp.responseText);
  1308.  
  1309. //jQuery.each(result,function(index, value){alert("ok");    
  1310. //console.log(value);
  1311. //});
  1312. document.getElementById("client_wrap").innerHTML=result.option;
  1313. //jQuery("#business_name").val(result.content.firstname);
  1314. //jQuery("#business_address").val(result.content.address);
  1315. //jQuery("#business_city").val(result.content.city);
  1316. //jQuery("#bus_state").val(resu editlt.content.state);
  1317. //jQuery("#business_country").val(result.content.country);
  1318. //jQuery("#business_zip").val(result.content.zip_code);
  1319. //jQuery("#business_phone").val(result.content.phone);
  1320. //jQuery("#business_url").val(result.content.url);
  1321. //jQuery("#business_gmail").val(result.content.email);
  1322. //jQuery("#business_password").val(result.content.password);
  1323. }
  1324. };
  1325. xmlhttp.open("GET","/wp-content/plugins/Membership_dashborad/get_tasklist.php?id="+str,true);
  1326. xmlhttp.send();
  1327. }
  1328. }
  1329. */
  1330. jQuery(document).ready(function(){
  1331. jQuery('#client_wrap').change(function() {
  1332.       var x = jQuery(this).find(':selected')[0].id;
  1333. x;
  1334.       jQuery('#changevalue').val(x);
  1335.   });
  1336.  
  1337.  jQuery('#master_wrap').on('change', function(e){
  1338. var master_wrap = this.value;
  1339.  if(master_wrap){
  1340.             jQuery.ajax({
  1341.                 type:'POST',
  1342.                 url:'http://www.seocheatguides.com/wp-content/plugins/Membership_dashborad/ajaxData.php?master_wrap=' + master_wrap,
  1343.                 data:'master_wrap='+master_wrap,
  1344.                 success:function(html){
  1345.                     jQuery('#client_wrap').html(html);
  1346.                 }
  1347.             });
  1348.         }else{
  1349.             jQuery('#client_wrap').html('<option value="">Select country first</option>');
  1350.         }
  1351.     });
  1352.  
  1353. var code = {};
  1354. jQuery("select[name='master_tasklist'] > option").each(function () {
  1355.     if(code[this.text]) {
  1356.         jQuery(this).remove();
  1357.     } else {
  1358.         code[this.text] = this.value;
  1359.     }
  1360. })
  1361.  
  1362. });
  1363.     </script>
  1364.     <h1 style="text-align:center;">Assign Tasks</h1>
  1365.     <table class="widefat membership-levels">
  1366.     <thead>
  1367.         <tr>
  1368.             <th>Client Pull Down Menu</th>
  1369.             <th>Master Pull Down Menu</th>
  1370.             <th>Task Pull Down Menu</th>
  1371.             <th>Employee Pull Down Menu</th>
  1372.         </tr>
  1373.     </thead>
  1374.     <tbody class="ui-sortable">
  1375.         <tr class="ui-sortable-handle">        
  1376.    
  1377.     <form class="form-horizontal" role="form" id="assign_task" action="" method="POST">        
  1378.     <td>
  1379.     <?php global $wpdb;
  1380.      $id = get_current_user_id();  
  1381.     $clienttask_id = $wpdb->get_results( 'SELECT * FROM wpmw_users where user_client = 1 and current_client_user_id  ="'.$id.'" ');
  1382.     //print_r($clienttask_id);
  1383.     ?>
  1384.     <select name="cli_task" onchange="clienttasklist(this.value)">
  1385.    
  1386.     <?php foreach($clienttask_id as $cid){// print_r($cid);
  1387.     $st_ligin =  $cid->user_login;
  1388.     $blw_id = preg_replace('/\s+/', '', $st_ligin); $str_uslogin= strtolower($blw_id); ?>
  1389.     <option login_value="0" class="user" value="<?php echo $str_uslogin;?>"><?php echo $str_uslogin;?></option>
  1390.     <?php echo $cid->ID;?>
  1391.     <?php
  1392.     } ?>
  1393. </select>
  1394.    
  1395. </td>
  1396.  
  1397. <td><?php global $wpdb;
  1398.     $master_meta = $wpdb->get_results( 'SELECT * FROM wpmw_tasklist ORDER BY master_list ASC');  ?>
  1399.     <select name="master_tasklist" id="master_wrap" onChange="printMasterMenu(this.value);"<?php
  1400.     foreach($master_meta as $masterassign){
  1401.     $mst_task = $masterassign->master_list;
  1402.     $must = preg_replace('/\s+/', '', $mst_task);
  1403.     $master_str = strtolower($must);?>
  1404. <option task_value="0" id="<?php echo $taskassign->id;?>" name="master_options" value="<?php echo $mst_task;?>"><?php echo $mst_task; ?></option>
  1405. <?php
  1406.     }?>
  1407. </select>
  1408. </td>
  1409.  
  1410.     <td>
  1411.     <?php global $wpdb;
  1412.     $taskmeta = $wpdb->get_results( 'SELECT * FROM wpmw_tasklist');
  1413.     //print_r($taskmeta);   ?>
  1414.     <select name="empl_tasklist" id="client_wrap"><?php
  1415.     foreach($taskmeta as $taskassign){
  1416.     $str_task = $taskassign->task_list;
  1417.     $taskassign->id;
  1418.     $blw = preg_replace('/\s+/', '', $str_task);
  1419.     $task_str = strtolower($blw);
  1420.      ?>
  1421.     <option task_value="0" id="<?php echo $taskassign->id;?>" name="item_options" value="<?php echo $task_str;?>"><?php echo $task_str; ?></option>
  1422. <?php
  1423.     }?>
  1424. </select>
  1425. <input type="hidden" name="item_options" value="<?php echo $taskassign->id;?>" id="changevalue" />
  1426. </td>
  1427. <td>
  1428.     <?php global $wpdb;
  1429.     $id = get_current_user_id();
  1430.     $employ_id= $wpdb->get_results( 'SELECT * FROM wpmw_users where user_employee = 1 and current_employee_user_id ="'.$id.'" '); ?>
  1431.     <select name="employ_task">
  1432.     <?php
  1433.     foreach($employ_id as $em){ //print_r($em);
  1434.     $str_email = $em->user_nicename;
  1435.     $vrt =  preg_replace('/\s+/', '', $str_email);
  1436.     $email_employ = strtolower($vrt);
  1437. ?>
  1438.     <option empl_value="0" value="<?php echo $email_employ;?>"><?php echo $email_employ; ?></option>
  1439. <?php
  1440.     }?>
  1441. </select>
  1442.     </td>      
  1443. <td>
  1444.  
  1445. <input type="submit" id="add_assign_task"  name="submit_assign_task" class="button-primary" value="ADD"/>
  1446. <input type="hidden" name="tsk_Id" value="<?php echo $mst_task_id; ?>" id="tsk_Id" showmid="<?php echo $mst_task_id; ?>">
  1447. <?php
  1448. if(isset($_POST['submit_assign_task']))
  1449. {
  1450.    
  1451.      $cli_task = $_POST['cli_task'];
  1452.      $empl_tasklist = $_POST['empl_tasklist'];
  1453.      $client_data = $_POST['employ_task'];
  1454.      $job_key =  uniqid()."_".$_POST['cli_task'];
  1455.      $item_options = $_POST['item_options'];
  1456.      $master_tasklist = $_POST['master_tasklist'];
  1457.      $user = get_userdatabylogin($_REQUEST['cli_task']);
  1458.     if($user)   $up_id = $user->ID;
  1459.  
  1460.  
  1461.     $data_employee = $wpdb->query('INSERT INTO wpmw_assign_tasks(task_id,client_menu,task_menu,master_menu,employee_menu,job_status,job_key, assign_client_id) VALUES ("'.$item_options.'","'.$cli_task.'","'.$empl_tasklist.'","'. $master_tasklist.'","'.$client_data.'","'.pending.'", "'.$job_key.'","'.$up_id.'")');
  1462. //echo 'INSERT INTO wpmw_assign_tasks(task_id,client_menu,task_menu,master_menu,employee_menu,job_status,job_key, assign_client_id) VALUES ("'.$item_options.'","'.$cli_task.'","'.$empl_tasklist.'","'. $master_tasklist.'","'.$client_data.'","'.pending.'", "'.$job_key.'","'.$up_id.'")'
  1463.  
  1464. ?>
  1465. <tr><?php if( $data_employee ){echo "<p style='text-align: center; color: green; font-size: 18px;'>" . "You have assigned Task Successfully.Thank You!! ";}else{"Please Maintain this task List!" . "</p>"; }?></tr>
  1466. <?php
  1467.         /*global $wpdb;
  1468.         $id = get_current_user_id();
  1469.         $employ_id1= $wpdb->get_results( 'SELECT * FROM wpmw_users where user_employee = 1 and current_employee_user_id ="'.$id.'" ');
  1470.  
  1471.         foreach($employ_id1 as $ww){  $email_employ = $ww->user_email; $ww->user_email;
  1472.         $to = $email_employ;
  1473.         $subject = "Seocvjat Notification Email";
  1474.         $message = 'Seocvjat Notification Email: Your Job Notification Email Is pending, Click the link to Complete it'. "\r\n";
  1475.         //$message .= $client_data ;
  1476.         $message .= 'www.seocheatguides.com/assign-tasks/?job_status=pending&job_key='.$job_key;
  1477.  
  1478.         $header =  $email_employ;
  1479.         $header .= "Cc:shrutisinghh77@gmail.com";
  1480.         $header .= "MIME-Version: 1.0";
  1481.         $header .= "Content-tyspe: text/html";
  1482.  
  1483.         $retval = mail ($to,$subject,$message,$header);
  1484.  
  1485.         if( $retval == true ) {
  1486.  
  1487.         echo "";
  1488.         }else {
  1489.         echo "Email could not be sent...";
  1490.         exit;
  1491.         }*/
  1492.     $id = get_current_user_id();
  1493. ?>
  1494.  
  1495. <?php
  1496. }
  1497.  
  1498. ?>
  1499. </td>
  1500. </tr></tbody>
  1501. </table>
  1502.  
  1503.  
  1504. <!--form class="form-horizontal business_class" id = "business_id"role="form" action="" method="POST">
  1505.  
  1506.     <div class="form-group">
  1507.     <label class="control-label col-sm-2"  for="assign_task">Business Name</label>
  1508.     <div class="col-sm-7">
  1509. <input type="hidden" id="employeeid">  
  1510.     <input name="business_name" type="text" class="form-control business-name" value="<?php //echo(isset($_POST['business_name']) ? $_POST['business_name'] : null); ?>" placeholder="Business Name" id="business_name" />
  1511.     </div>
  1512.     </div>
  1513.  
  1514.     <div class="form-group">
  1515.     <label class="control-label col-sm-2" for="business_address">Business Address</label>
  1516.     <div class="col-sm-7">
  1517.     <input type="text" name="business_address" class="form-control business_address" value="<?php// echo(isset($_POST['business_address']) ? $_POST['business_address'] : null); ?>" id="business_address" PLaceholder="Business Address" />
  1518.     </div>
  1519.     </div>
  1520.  
  1521.     <div class="form-group">
  1522.     <label class="control-label col-sm-2" for="business_city">City</label>
  1523.     <div class="col-sm-7">
  1524.     <input type="text" name="business_city" class="form-control business_city" value="<?php //echo(isset($_POST['business_city']) ? $_POST['business_city'] : null); ?>" id="business_city" PLaceholder="Business City" />
  1525.     </div>
  1526.     </div>
  1527.  
  1528.     <div class="form-group">
  1529.     <label class="control-label col-sm-2" for="bus_state">State/Province</label>
  1530.     <div class="col-sm-7">
  1531.     <input type="text" name="bus_state" value="<?php //echo(isset($_POST['bus_state']) ? $_POST['bus_state'] : null); ?>" class="form-control bus_state" id="bus_state" PLaceholder="State/Province"/>
  1532.     </div>
  1533.     </div>
  1534.  
  1535.     <div class="form-group">
  1536.     <label class="control-label col-sm-2" for="business_zip">Zip/Postal Code</label>
  1537.     <div class="col-sm-7">
  1538.     <input type="text" name="business_zip" class="form-control" value="<?php// echo(isset($_POST['business_zip']) ? $_POST['business_zip'] : null); ?>" id="business_zip" PLaceholder="Business Zip code"/>
  1539.     </div>
  1540.     </div>
  1541.  
  1542.     <div class="form-group">
  1543.     <label class="control-label col-sm-2" for="business_country">Country</label>
  1544.     <div class="col-sm-7">
  1545.     <input type="text" name="business_country" class="form-control" value="<?php //echo(isset($_POST['business_country']) ? $_POST['business_country'] : null); ?>" id="business_country" PLaceholder="Country"/>
  1546.     </div>
  1547.     </div>
  1548.  
  1549.     <div class="form-group">
  1550.     <label class="control-label col-sm-2" for="business_phone">Phone Number</label>
  1551.     <div class="col-sm-7">
  1552.     <input type="text" name="business_phone" class="form-control" value="<?php //echo(isset($_POST['business_phone']) ? $_POST['business_phone'] : null); ?>" id="business_phone" placeholder="Phone Number"/>
  1553.     </div>
  1554.     </div>
  1555.  
  1556.     <div class="form-group">
  1557.     <label class="control-label col-sm-2" for="business_url">Website Url</label>
  1558.     <div class="col-sm-7">
  1559.     <input type="text" name="business_url" class="form-control" value="<?php //echo(isset($_POST['business_url']) ? $_POST['business_url'] : null); ?>" id="business_url"  placeholder="website Url"/>
  1560.     </div>
  1561. <div class="heading_otr">
  1562. <h2>Gmail Information</h2></div>
  1563.  
  1564. <div class="form-group">
  1565.     <label class="control-label col-sm-2" for="business_gmail">Gmail</label>
  1566.     <div class="col-sm-7">
  1567.     <input type="text" name="business_gmail" class="form-control" value="<?php//echo(isset($_POST['business_gmail']) ? $_POST['business_gmail'] : null); ?>" id="business_gmail" placeholder="Gmail"/>
  1568.     </div>
  1569.     </div>fgfdg
  1570.  
  1571.     <div class="form-group">
  1572.     <label class="control-label col-sm-2" for="business_password">Password</label>
  1573.     <div class="col-sm-7">
  1574.     <input type="password" name="business_password" class="form-control" value="<?php// echo(isset($_POST['business_password']) ? $_POST['business_password'] : null); ?>" id="business_password"  placeholder="Password"/>
  1575.     </div>
  1576.     </div>
  1577.     <div class="form-group">
  1578.     <div class="col-sm-offset-2 col-sm-10">
  1579.     <input type="submit" class="btn btn-default" name=business_submit" value="Submit" id="business_submitt"/>
  1580.     </div>
  1581.     </div>
  1582.  
  1583. </form-->
  1584.  
  1585. <style>#business_id { float: left; width: 15%; }</style>
  1586.  
  1587. <?php
  1588.  
  1589. }
  1590.  
  1591.  
  1592.  
  1593. /************ Employees/Assistant clients  ******************/
  1594. function clivern_employee_page(){
  1595. ?>
  1596.  
  1597. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  1598. <script>
  1599. jQuery(document).ready(function(){
  1600. /*
  1601. jQuery('#employee_phone').on('keyup',function()
  1602.   {
  1603.     this.value = this.value.replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,'$1-$2-$3');
  1604.     return false;
  1605. });*/
  1606.  
  1607.  
  1608. jQuery('.employee_information').append('<span class="pmpro_asterisk"> <abbr title="Required Field">*</abbr></span>');
  1609.  
  1610.  jQuery(".chng_pwd").click(function(){
  1611. var empId = jQuery(this).attr('id');
  1612. jQuery("#emp_id").val(empId);
  1613. //alert(jQuery(this).attr('id'));
  1614. jQuery('#myModal').modal('show') ;
  1615. });
  1616.  
  1617. jQuery("#employee_submit").click(function(){
  1618.  
  1619. var employee_name =jQuery('#employee_name').val();
  1620. if(employee_name==""){
  1621.  
  1622. jQuery("#employee_name").css("border-color" , "red");
  1623. jQuery("#employee_name").focus();
  1624. return false;
  1625. }
  1626. else
  1627. {
  1628. jQuery("#employee_name").css("border-color", "#dadada");
  1629. }
  1630.  
  1631.  var employee_email = jQuery("#employee_email").val();
  1632. if(employee_email == ""){
  1633. jQuery("#employee_email").css("border-color" , "red");
  1634. jQuery("#employee_email").focus();
  1635. return false;
  1636. }
  1637. function IsEmail(email) {
  1638.   var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  1639.   return regex.test(email);
  1640. }
  1641. if(IsEmail(employee_email)) {
  1642.         //   alert("valid");
  1643.             jQuery("#employee_email").css("border-color" , "rgb(225, 225, 225)");
  1644.            
  1645.         }
  1646.         else
  1647.         {
  1648.        
  1649.         jQuery("#employee_email").css("border-color" , "red");
  1650.         jQuery("#employee_email").focus();
  1651.         return false;
  1652.         }
  1653.  
  1654. var employee_login = jQuery('#employee_login').val();
  1655. if(employee_login==""){
  1656. jQuery("#employee_login").css("border-color" , "red");
  1657. jQuery("#employee_login").focus();
  1658. return false;
  1659. }
  1660. else
  1661. {
  1662. jQuery("#employee_login").css("border-color", "#dadada");
  1663. }
  1664.  
  1665. //var pattern = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$/;
  1666.  
  1667. data = jQuery('#employee_password').val();
  1668.         var len = data.length;
  1669.        // alert(len);
  1670.         if(len < 8) {
  1671.            alert("Assistant Password should be at least 8 characters");
  1672. jQuery("#employee_password").css("border-color" , "red");
  1673. return false;
  1674.         }else if(len > 8){
  1675.   alert("only 8 characters allowed");
  1676. return false;
  1677. }else{}
  1678.  
  1679. });
  1680.     var text_max = 150;
  1681.     jQuery('#textarea_feedback').html(text_max + ' characters remaining');
  1682.  
  1683.     jQuery('#textarea').keyup(function() {
  1684.         var text_length = jQuery('#textarea').val().length;
  1685.         var text_remaining = text_max - text_length;
  1686.         jQuery('#textarea_feedback').html(text_remaining + ' characters remaining');
  1687.     });
  1688.  
  1689. });
  1690.  
  1691.  
  1692. jQuery(document).ready(function(){
  1693.  
  1694.  jQuery(".chng_pwd").click(function(){
  1695.  var field_id = jQuery(this).attr('id');
  1696.  
  1697. jQuery.ajax({
  1698. type:'POST',
  1699.     url:'http://www.seocheatguides.com/wp-content/plugins/Membership_dashborad/membership_fields.php?field_id='+field_id,
  1700.     data:"field_id="+field_id,
  1701.  
  1702.     success: function(data){
  1703.  
  1704.  jQuery('#myModal').html(data);
  1705.  
  1706.  
  1707. }
  1708. });
  1709.  
  1710. });
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  jQuery(".delete_class").click(function(){
  1716.  
  1717.  var del_id = jQuery(this).attr('id');
  1718. if(confirm('Are you sure you want to delete this?')==true){
  1719. jQuery.ajax({
  1720.     type:'POST',
  1721.     url:'http://www.seocheatguides.com/wp-content/plugins/Membership_dashborad/delete.php?del_id=" + del_id,',
  1722.     data:"del_id="+del_id,
  1723.  
  1724.     success: function(result){
  1725.  
  1726.          //alert(result);
  1727. if(result == 1){
  1728. alert("successfully deleted row!");
  1729. document.location.href = 'http://www.seocheatguides.com/wp-admin/admin.php?page=Membership_dashborad%2Fmembership_dashboard.php%2Fassign-tasks';
  1730. }
  1731. else{
  1732.  alert("can't delete this row..");
  1733. }
  1734.     }
  1735.  
  1736.      });
  1737. }
  1738.  
  1739. });
  1740.  var phone = {};
  1741.  
  1742. // http://country.io/phone.json
  1743. phone.codes = {"BD": "880", "BE": "32", "BF": "226", "BG": "359", "BA": "387", "WF": "681", "BL": "590", "BN": "673", "BO": "591", "BH": "973", "BI": "257", "BJ": "229", "BT": "975", "BV": "", "BW": "267", "WS": "685", "BQ": "599", "BR": "55", "BY": "375", "BZ": "501", "RU": "7", "RW": "250", "RS": "381", "TL": "670", "RE": "262", "TM": "993", "TJ": "992", "RO": "40", "TK": "690", "GW": "245", "GT": "502", "GS": "", "GR": "30", "GQ": "240", "GP": "590", "JP": "81", "GY": "592", "GF": "594", "GE": "995", "GB": "44", "GA": "241", "SV": "503", "GN": "224", "GM": "220", "GL": "299", "GI": "350", "GH": "233", "OM": "968", "TN": "216", "JO": "962", "HR": "385", "HT": "509", "HU": "36", "HK": "852", "HN": "504", "HM": " ", "VE": "58", "PS": "970", "PW": "680", "PT": "351", "SJ": "47", "PY": "595", "IQ": "964", "PA": "507", "PF": "689", "PG": "675", "PE": "51", "PK": "92", "PH": "63", "PN": "870", "PL": "48", "PM": "508", "ZM": "260", "EH": "212", "EE": "372", "EG": "20", "ZA": "27", "EC": "593", "IT": "39", "VN": "84", "SB": "677", "ET": "251", "SO": "252", "ZW": "263", "SA": "966", "ES": "34", "ER": "291", "ME": "382", "MD": "373", "MG": "261", "MF": "590", "MA": "212", "MC": "377", "UZ": "998", "MM": "95", "ML": "223", "MO": "853", "MN": "976", "MH": "692", "MK": "389", "MU": "230", "MT": "356", "MW": "265", "MV": "960", "MQ": "596", "MR": "222", "UG": "256", "TZ": "255", "MY": "60", "MX": "52", "IL": "972", "FR": "33", "IO": "246", "SH": "290", "FI": "358", "FJ": "679", "FK": "500", "FM": "691", "FO": "298", "NI": "505", "NL": "31", "NO": "47", "NA": "264", "VU": "678", "NC": "687", "NE": "227", "NF": "672", "NG": "234", "NZ": "64", "NP": "977", "NR": "674", "NU": "683", "CK": "682", "XK": "", "CI": "225", "CH": "41", "CO": "57", "CN": "86", "CM": "237", "CL": "56", "CC": "61", "CA": "1", "CG": "242", "CF": "236", "CD": "243", "CZ": "420", "CY": "357", "CX": "61", "CR": "506", "CW": "599", "CV": "238", "CU": "53", "SZ": "268", "SY": "963", "SX": "599", "KG": "996", "KE": "254", "SS": "211", "SR": "597", "KI": "686", "KH": "855", "KM": "269", "ST": "239", "SK": "421", "KR": "82", "SI": "386", "KP": "850", "KW": "965", "SN": "221", "SM": "378", "SL": "232", "SC": "248", "KZ": "7", "SG": "65", "SE": "46", "SD": "249", "DJ": "253", "DK": "45", "DE": "49", "YE": "967", "DZ": "213", "US": "1", "UY": "598", "YT": "262", "UM": "1", "LB": "961", "LA": "856", "TV": "688", "TW": "886", "TR": "90", "LK": "94", "LI": "423", "LV": "371", "TO": "676", "LT": "370", "LU": "352", "LR": "231", "LS": "266", "TH": "66", "TF": "", "TG": "228", "TD": "235", "LY": "218", "VA": "379", "AE": "971", "AD": "376", "AF": "93", "IS": "354", "IR": "98", "AM": "374", "AL": "355", "AO": "244", "AQ": "", "AR": "54", "AU": "61", "AT": "43", "AW": "297", "IN": "91", "AZ": "994", "IE": "353", "ID": "62", "UA": "380", "QA": "974", "MZ": "258"};
  1744.  
  1745. // default country code instead of 8
  1746. phone.codes_default = '7';
  1747.  
  1748. // list of inputs
  1749. phone.input = document.querySelectorAll('#employee_phone');
  1750.  
  1751. phone.only_numbers = function(p) {
  1752.   return p.replace(new RegExp('[^0-9]','g'),'');
  1753. };
  1754.  
  1755. phone.format = function(input) {
  1756.   var p = phone.only_numbers(input.value);
  1757.   if(p && p.length > 0) {
  1758.     var formatted = '+';
  1759.     var code = '';
  1760.     for(i in this.codes) {
  1761.       if(this.codes[i] === p.substring(0,1) || (p.length > 1 && this.codes[i] === p.substring(0,2)) || (p.length > 2 && this.codes[i] === p.substring(0,3))) {
  1762.         code = this.codes[i];
  1763.       }
  1764.     }
  1765.     if(p.length > 2) {
  1766.       if(!code) {
  1767.         code = this.codes_default;
  1768.       }
  1769.       formatted += '('+code;
  1770.       if(p.length > (code.length+2)) {
  1771.         formatted += ')-('+p.substring(code.length,(code.length+3));
  1772.         if(p.length > (code.length+5)) {
  1773.           formatted += ')-'+p.substring((code.length+3),(code.length+6));
  1774.           if(p.length > (code.length+7)) {
  1775.             formatted += '-'+p.substring((code.length+6),(code.length+8));
  1776.             if(p.length > (code.length+9)) {
  1777.               if(p.length === (code.length+10)) {
  1778.                 formatted += ''+p.substring((code.length+8),(code.length+10));
  1779.               } else {
  1780.                 formatted += p.substring((code.length+8),(code.length+9));
  1781.                 if(p.length > (code.length+10) && p.length <= (code.length+12)) {
  1782.                   formatted += '-'+p.substring((code.length+9),p.length);
  1783.                 } else {
  1784.                   if(p.length > (code.length+12)) {
  1785.                     formatted += '-'+p.substring((code.length+9),(code.length+12))+'-'+p.substring((code.length+12),p.length);
  1786.                   }
  1787.                 }
  1788.               }
  1789.             }
  1790.             if(p.length === (code.length+9)) {
  1791.               formatted += '-'+p.substring((code.length+8),(code.length+9));
  1792.             }
  1793.           } else {
  1794.             if(p.length === (code.length+7)) {
  1795.               formatted += '-'+(p.substring((code.length+6),(code.length+7)));
  1796.             } else {
  1797.               formatted += (p.substring((code.length+6),p.length));
  1798.             }
  1799.           }
  1800.         } else {
  1801.           if(p.length === (code.length+4) || p.length === (code.length+5)) {
  1802.             formatted += '-'+(p.substring((code.length+3),p.length));
  1803.           } else {
  1804.             formatted += (p.substring((code.length+3),p.length));
  1805.           }
  1806.         }
  1807.       } else {
  1808.         formatted += ' '+(p.substring(code.length,p.length));
  1809.       }
  1810.       input.value = formatted;
  1811.     }
  1812.   }
  1813. };
  1814.  
  1815. for(var i = 0; i < phone.input.length; i++) {
  1816.   phone.input[i].onkeydown = function(e) {
  1817.     var key = e.charCode || e.keyCode || 0;
  1818.     if(((key == 8 || key == 9 || key == 46 || (key >= 48 && key <= 57) || (key >= 96 && key <= 105)) && !e.shiftKey) || (key == 65 && e.ctrlKey)) {  
  1819.       if((key >= 48 && key <= 57) || (key >= 96 && key <= 105)) {
  1820.         phone.format(this);
  1821.       }
  1822.     } else {
  1823.       return false;
  1824.     }
  1825.   };
  1826.   phone.input[i].onkeyup = function() {
  1827.     if(phone.only_numbers(this.value).length > 12) {
  1828.       this.value = this.value.substring(0,(this.value.length-1));
  1829.     }
  1830.   };
  1831.   phone.input[i].onblur = function() {
  1832.     phone.format(this);
  1833.   };
  1834.   phone.input[i].onclick = function() {
  1835.     phone.format(this);
  1836.   };
  1837. }
  1838. jQuery("#update_assistant").click(function(){
  1839. var name_assistant = jQuery('#name_assistant').val();
  1840. if(name_assistant == ""){
  1841. jQuery("#name_assistant").css("border-color" , "red");
  1842. jQuery("#name_assistant").focus();
  1843. return false;
  1844. }
  1845. else
  1846. {
  1847. jQuery("#name_assistant").css("border-color", "#dadada");
  1848. }  
  1849.  
  1850. var assistant_email = jQuery('#assistant_email').val();
  1851. if(assistant_email == ""){
  1852. jQuery("#assistant_email").css("border-color" , "red");
  1853. jQuery("#assistant_email").focus();
  1854. return false;
  1855. }
  1856. else
  1857. {
  1858. jQuery("#assistant_email").css("border-color", "#dadada");
  1859. }
  1860.  
  1861. var check_login = jQuery('#check_login').val();
  1862. if(check_login == ""){
  1863. jQuery("#check_login").css("border-color" , "red");
  1864. jQuery("#check_login").focus();
  1865. return false;
  1866. }
  1867. else
  1868. {
  1869. jQuery("#check_login").css("border-color", "#dadada");
  1870. }  
  1871.  
  1872. var required_pass = jQuery('#required_pass').val();
  1873. if(required_pass == ""){
  1874. jQuery("#required_pass").css("border-color" , "red");
  1875. jQuery("#required_pass").focus();
  1876. return false;
  1877. }
  1878. else
  1879. {
  1880. jQuery("#required_pass").css("border-color", "#dadada");
  1881. }          
  1882. });
  1883. });
  1884. </script>
  1885.  
  1886. <style>
  1887. .form-control.name-field {
  1888.     width: 78%;
  1889. }
  1890.  
  1891. .form-control.employee_phone{
  1892.     width:78%;
  1893. }
  1894. .mandatory > p{
  1895.     color: red;
  1896.     font-size: 13px;
  1897.     margin-top: 15px;
  1898. }
  1899. .control-label.col-sm-2.check_assistant {
  1900.     width: 33%;
  1901. }
  1902. .check_assistant {
  1903.     width: 100%;
  1904. }
  1905. .pmpro_asterisk{float: right;width: auto;}
  1906. .form-horizontal .col-sm-7 input{float:left;}
  1907. #textarea {
  1908.     margin-left: 115px;
  1909.     width: 78%;
  1910.     padding-bottom: 30px;
  1911. }
  1912.  
  1913. </style>
  1914.  
  1915.  <h2 style="text-align:center;">Register a New Assistant</h2>
  1916. <form class="form-horizontal" role="form" action="" method="POST">
  1917.  
  1918.     <div class="form-group">
  1919.     <label class="required control-label col-sm-2"  for="employee">Assistant Name</label>
  1920.     <div class="col-sm-7 employee_information">
  1921.     <input name="employee_name" type="text" class="form-control name-field" value="" placeholder="Employee Name" id="employee_name" />
  1922.     </div>
  1923.     </div>
  1924.  
  1925.     <div class="form-group">
  1926.     <label class="required control-label col-sm-2" for="employee_email">Assistant Email</label>
  1927.     <div class="col-sm-7 employee_information">
  1928.     <input type="text" name="employee_email" class="form-control name-field" value="" id="employee_email" PLaceholder="Employee Email" />
  1929.     </div>
  1930.     </div>
  1931.  
  1932. <div class="form-group">
  1933.     <label class="control-label col-sm-2" for="phone_number">Phone Number</label>
  1934.     <div class="col-sm-7">
  1935.     <input type="text" name="employee_phone" class="form-control employee_phone" value="" id="employee_phone" PLaceholder="Phone Number" />
  1936.     </div>
  1937.     </div>
  1938.  
  1939. <div class="form-group">
  1940.     <label class="control-label col-sm-2" for="comment">Comments About Assistant</label>
  1941.     <div class="col-sm-7">
  1942.     <textarea id="textarea" name="comment" PLaceholder="Comments About Assistant" maxlength='150'></textarea>
  1943.     </div><div id="textarea_feedback"></div>
  1944.     </div>
  1945.  
  1946.  
  1947.  
  1948.     <div class="form-group">
  1949.     <label class="required control-label col-sm-2" for="employee_login">Assistant Login</label>
  1950.     <div class="col-sm-7 employee_information">
  1951.     <input type="text" name="employee_login" class="form-control name-field" value="" id="employee_login" PLaceholder="Employee Login" />
  1952.     </div>
  1953.     </div>
  1954.  
  1955.     <div class="form-group">
  1956.     <label class="required control-label col-sm-2" for="password">Assistant Password</label>
  1957.     <div class="col-sm-7 employee_information">
  1958.     <input type="password" name="employee_password" value="" class="form-control name-field" id="employee_password" PLaceholder="Password"/>
  1959.     </div>
  1960.     </div>
  1961.  
  1962.     <div class="form-group">
  1963.     <div class="col-sm-offset-2 col-sm-10" style="margin-left: 26.667%;">
  1964.     <input type="submit" class="btn btn-primary" name="employee_submit" value="Add New Assistant" id="employee_submit"/>
  1965.     </div>
  1966.     </div>
  1967.  
  1968. </form>
  1969. <div id="counter"></div>
  1970.  
  1971. <?php
  1972. if(isset($_POST['employee_submit']))
  1973. {
  1974.     $string_employee  =  $_POST['employee_name'];
  1975.     $stt =  preg_replace('/\s+/', '', $string_employee);
  1976.     $employee_name  = strtolower($stt);
  1977.     $employee_email    = trim( strip_tags( stripslashes( $_POST['employee_email']) ) );
  1978.     $assistant_phone = $_POST['employee_phone'];
  1979.     $employee_comment = $_POST['comment'];
  1980.     $string_login   =  $_POST['employee_login'];
  1981.     $st =  preg_replace('/\s+/', '', $string_login);
  1982.     $employee_login  = strtolower($st);
  1983.     $employee_password = $_POST['employee_password'];
  1984.  
  1985. global $wpdb;
  1986.  
  1987.  $client_sql = "select * from wpmw_users where user_email='$employee_email'";
  1988.  $client_query=mysql_query($client_sql);
  1989.  $count=mysql_num_rows($client_query);
  1990. if($count>0){
  1991. echo "Sorry, that email address is already used! Try Something new...";
  1992. return false;
  1993. }
  1994.  
  1995.  $table_name = $wpdb->prefix . "users";
  1996.  $id = get_current_user_id();
  1997.  $wpdb->query('Insert into '.$table_name.' (user_nicename,user_email,user_login,user_pass,user_registered, user_status, display_name,user_employee,current_employee_user_id) values("'.$employee_name.'","'.$employee_email.'","'.$employee_login.'","'.MD5($employee_password).'","'.$time.'", "0", "'.$employee_name.'","1","'.$id.'")');
  1998.  $employee_data = 'Insert into '.$table_name.' (user_nicename,user_email,user_login,user_pass,user_registered, user_status, display_name,user_employee,current_employee_user_id) values("'.$employee_name.'","'.$employee_email.'","'.$employee_login.'","'.MD5($employee_password).'","'.$time.'", "0", "'.$employee_name.'","1","'.$id.'")';
  1999.  $id = get_current_user_id();
  2000. //preg_replace('/\s+/', '', $str_login);
  2001.     $emp_sql="select * from $table_name order by id desc limit 0,1";
  2002.     $emp_query=mysql_query($emp_sql);
  2003.     $emp_fetch=mysql_fetch_array($emp_query);
  2004.          
  2005. // print_r($emp_fetch);
  2006. $capa='a:1:{s:12:"file_manager";b:1;}';
  2007.  
  2008. $emp_user_id = $emp_fetch["ID"];
  2009.  
  2010. $usermeta_table_name = $wpdb->prefix . "usermeta";
  2011. $wpdb->query("INSERT INTO $usermeta_table_name (umeta_id,user_id,meta_key,meta_value)
  2012.     VALUES ( NULL,$emp_user_id,'wpmw_capabilities','$capa' )");
  2013. $wpdb->query("INSERT INTO $usermeta_table_name (umeta_id,user_id,meta_key,meta_value)
  2014.     VALUES ( NULL,$emp_user_id,'wpmw_user_level',0 )");
  2015. $wpdb->query("INSERT INTO $usermeta_table_name (umeta_id,user_id,meta_key,meta_value)
  2016.     VALUES ( NULL,$emp_user_id,'employee_id','$id' )");
  2017. $wpdb->query("INSERT INTO $usermeta_table_name (umeta_id,user_id,meta_key,meta_value)
  2018.     VALUES ( NULL,$emp_user_id,'employee_phone','$assistant_phone' )");
  2019. $wpdb->query("INSERT INTO $usermeta_table_name (umeta_id,user_id,meta_key,meta_value)
  2020.     VALUES ( NULL,$emp_user_id,'employee_comment','$employee_comment')");
  2021.  
  2022. if( $employee_data ){
  2023.             echo "Thank You for creating new assistant...";
  2024.     //header('Location:http://www.seocheatguides.com/wp-admin/admin.php?page=Membership_dashborad%2Fmembership_dashboard.php%2Fassign-tasks');
  2025.         }else{
  2026.             echo "Insertion failed";
  2027.         }
  2028.   }
  2029.  
  2030.  
  2031.  
  2032. $employee_id  =  $_POST['employee_id'];
  2033. $table_name = $wpdb->prefix . "users";
  2034.  
  2035. global $wpdb;
  2036. $id = get_current_user_id();
  2037. $user_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->users" );
  2038. $results = $wpdb->get_results( 'SELECT * FROM wpmw_users where user_employee = "1" and current_employee_user_id ="'.$id.'" ');
  2039. //print_r($results);
  2040.  
  2041. ?>
  2042. <table class="widefat membership-levels">
  2043. <thead>
  2044.   <tr>
  2045.     <th>Assistant Name</th>
  2046.     <th>Assistant Email</th>   
  2047.     <th>Assistant Login</th>
  2048.     <th>Password</th>
  2049.     <th>Change Assistant Information</th>
  2050.     <th>Delete Account</th>
  2051.   </tr>
  2052. </thead>
  2053. <?php
  2054.  
  2055. foreach($results as $request){
  2056. $str = $request->user_nicename;
  2057. $test_nce = preg_replace('/\s+/', '', $str);
  2058. $test = strtolower($test_nce);
  2059.  
  2060. $str_login = $request->user_login;
  2061. $txt_log = preg_replace('/\s+/', '', $str_login);
  2062. $test_login = strtolower($txt_log);
  2063. //print_r($test_login);
  2064. //echo '<p>' .$request->employee_email. '</p>';
  2065.  
  2066. ?>
  2067.  <tbody class="ui-sortable">
  2068.     <tr class="ui-sortable-handle">
  2069.     <td><?php echo $test; ?></td>
  2070.     <td><?php echo $request->user_email; ?></td>
  2071.     <td><?php echo $test_login; ?></td>
  2072.     <td><?php echo $request->user_pass;?></td>
  2073.     <td>
  2074. <button type="button" class="chng_pwd" id="<?php echo $request->ID; ?>" data-toggle="modal" >Update Information</button></td>      
  2075.     <td><!--span><a showid="<?php //echo $request->employee_id; ?>" id="dis_edit" class="editid<?php //echo $request->employee_id; ?>" href=""> Edit </a></span-->
  2076.  
  2077. <form action ="" method="POST">
  2078.  
  2079. <?php
  2080.  
  2081. global $wpdb;
  2082. $res11 = $wpdb->get_results( "SELECT job_status FROM wpmw_assign_tasks where employee_menu = '$str'");
  2083.  
  2084. $arr=array();
  2085. foreach($res11 as $redf){
  2086. //print_r($redf);
  2087. array_push($arr,$redf->job_status);
  2088. }
  2089. if(in_array("pending", $arr) || $arr=='' ||$arr =='Registered'){
  2090. ?>
  2091. <input type="button"  class="delete_class btn btn-danger" title ="Can't delete this detail until complete the job" name="submit" id="<?php echo $request->ID;?>" value="Delete" disabled>
  2092. <?php
  2093.  
  2094. }
  2095. else{
  2096. ?>
  2097. <input type="button"  class="delete_class btn btn-danger" name="submit" id="<?php echo $request->ID;?>" value="Delete">
  2098. <?php
  2099.  
  2100. }
  2101. ?>
  2102. </form>
  2103.  
  2104.     <!--a href="http://www.seocheatguides.com/wp-admin/admin.php?page=Membership_dashborad%2Fmembership_dashboard.php%2Fassign-tasks&action=delete&id=<?php echo $request->ID; ?>" class="btn btn-danger">Delete</a-->
  2105. </td>
  2106.  
  2107.   </tbody>
  2108.         </tr>
  2109.  
  2110.  
  2111.   <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  2112.   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  2113.   <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  2114.  
  2115. <div class="modal fade" id="myModal" role="dialog">
  2116.    
  2117.   </div><?php } ?>
  2118.  
  2119. </table>
  2120. <style>
  2121. .check_model form .form-group {
  2122.   float: left;
  2123.   margin: 0;
  2124.   width: 100%;
  2125. }
  2126. </style>
  2127. <div class="mandatory">
  2128. <p>* Denotes a mandatory field</p>
  2129. </div>
  2130. <?php
  2131. }
  2132.  
  2133.  
  2134. /************ Add New Clients  ******************/
  2135. function clivern_render_client_page(){
  2136. ?>
  2137.  <h1 style="text-align:center;">Register a New Client</h1>
  2138. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  2139. <script>
  2140. jQuery(document).ready(function(){
  2141.  
  2142. jQuery('.register_Information').append('<span class="pmpro_asterisk"> <abbr title="Required Field">*</abbr></span>');
  2143. var phone = {};
  2144.  
  2145. // http://country.io/phone.json
  2146. phone.codes = {"BD": "880", "BE": "32", "BF": "226", "BG": "359", "BA": "387", "WF": "681", "BL": "590", "BN": "673", "BO": "591", "BH": "973", "BI": "257", "BJ": "229", "BT": "975", "BV": "", "BW": "267", "WS": "685", "BQ": "599", "BR": "55", "BY": "375", "BZ": "501", "RU": "7", "RW": "250", "RS": "381", "TL": "670", "RE": "262", "TM": "993", "TJ": "992", "RO": "40", "TK": "690", "GW": "245", "GT": "502", "GS": "", "GR": "30", "GQ": "240", "GP": "590", "JP": "81", "GY": "592", "GF": "594", "GE": "995", "GB": "44", "GA": "241", "SV": "503", "GN": "224", "GM": "220", "GL": "299", "GI": "350", "GH": "233", "OM": "968", "TN": "216", "JO": "962", "HR": "385", "HT": "509", "HU": "36", "HK": "852", "HN": "504", "HM": " ", "VE": "58", "PS": "970", "PW": "680", "PT": "351", "SJ": "47", "PY": "595", "IQ": "964", "PA": "507", "PF": "689", "PG": "675", "PE": "51", "PK": "92", "PH": "63", "PN": "870", "PL": "48", "PM": "508", "ZM": "260", "EH": "212", "EE": "372", "EG": "20", "ZA": "27", "EC": "593", "IT": "39", "VN": "84", "SB": "677", "ET": "251", "SO": "252", "ZW": "263", "SA": "966", "ES": "34", "ER": "291", "ME": "382", "MD": "373", "MG": "261", "MF": "590", "MA": "212", "MC": "377", "UZ": "998", "MM": "95", "ML": "223", "MO": "853", "MN": "976", "MH": "692", "MK": "389", "MU": "230", "MT": "356", "MW": "265", "MV": "960", "MQ": "596", "MR": "222", "UG": "256", "TZ": "255", "MY": "60", "MX": "52", "IL": "972", "FR": "33", "IO": "246", "SH": "290", "FI": "358", "FJ": "679", "FK": "500", "FM": "691", "FO": "298", "NI": "505", "NL": "31", "NO": "47", "NA": "264", "VU": "678", "NC": "687", "NE": "227", "NF": "672", "NG": "234", "NZ": "64", "NP": "977", "NR": "674", "NU": "683", "CK": "682", "XK": "", "CI": "225", "CH": "41", "CO": "57", "CN": "86", "CM": "237", "CL": "56", "CC": "61", "CA": "1", "CG": "242", "CF": "236", "CD": "243", "CZ": "420", "CY": "357", "CX": "61", "CR": "506", "CW": "599", "CV": "238", "CU": "53", "SZ": "268", "SY": "963", "SX": "599", "KG": "996", "KE": "254", "SS": "211", "SR": "597", "KI": "686", "KH": "855", "KM": "269", "ST": "239", "SK": "421", "KR": "82", "SI": "386", "KP": "850", "KW": "965", "SN": "221", "SM": "378", "SL": "232", "SC": "248", "KZ": "7", "SG": "65", "SE": "46", "SD": "249", "DJ": "253", "DK": "45", "DE": "49", "YE": "967", "DZ": "213", "US": "1", "UY": "598", "YT": "262", "UM": "1", "LB": "961", "LA": "856", "TV": "688", "TW": "886", "TR": "90", "LK": "94", "LI": "423", "LV": "371", "TO": "676", "LT": "370", "LU": "352", "LR": "231", "LS": "266", "TH": "66", "TF": "", "TG": "228", "TD": "235", "LY": "218", "VA": "379", "AE": "971", "AD": "376", "AF": "93", "IS": "354", "IR": "98", "AM": "374", "AL": "355", "AO": "244", "AQ": "", "AR": "54", "AU": "61", "AT": "43", "AW": "297", "IN": "91", "AZ": "994", "IE": "353", "ID": "62", "UA": "380", "QA": "974", "MZ": "258"};
  2147.  
  2148. // default country code instead of 8
  2149. phone.codes_default = '7';
  2150.  
  2151. // list of inputs
  2152. phone.input = document.querySelectorAll('#phone_address');
  2153.  
  2154. phone.only_numbers = function(p) {
  2155.   return p.replace(new RegExp('[^0-9]','g'),'');
  2156. };
  2157.  
  2158. phone.format = function(input) {
  2159.   var p = phone.only_numbers(input.value);
  2160.   if(p && p.length > 0) {
  2161.     var formatted = '+';
  2162.     var code = '';
  2163.     for(i in this.codes) {
  2164.       if(this.codes[i] === p.substring(0,1) || (p.length > 1 && this.codes[i] === p.substring(0,2)) || (p.length > 2 && this.codes[i] === p.substring(0,3))) {
  2165.         code = this.codes[i];
  2166.       }
  2167.     }
  2168.     if(p.length > 2) {
  2169.       if(!code) {
  2170.         code = this.codes_default;
  2171.       }
  2172.       formatted += '('+code;
  2173.       if(p.length > (code.length+2)) {
  2174.         formatted += ')-('+p.substring(code.length,(code.length+3));
  2175.         if(p.length > (code.length+5)) {
  2176.           formatted += ')-'+p.substring((code.length+3),(code.length+6));
  2177.           if(p.length > (code.length+7)) {
  2178.             formatted += '-'+p.substring((code.length+6),(code.length+8));
  2179.             if(p.length > (code.length+9)) {
  2180.               if(p.length === (code.length+10)) {
  2181.                 formatted += ''+p.substring((code.length+8),(code.length+10));
  2182.               } else {
  2183.                 formatted += p.substring((code.length+8),(code.length+9));
  2184.                 if(p.length > (code.length+10) && p.length <= (code.length+12)) {
  2185.                   formatted += '-'+p.substring((code.length+9),p.length);
  2186.                 } else {
  2187.                   if(p.length > (code.length+12)) {
  2188.                     formatted += '-'+p.substring((code.length+9),(code.length+12))+'-'+p.substring((code.length+12),p.length);
  2189.                   }
  2190.                 }
  2191.               }
  2192.             }
  2193.             if(p.length === (code.length+9)) {
  2194.               formatted += '-'+p.substring((code.length+8),(code.length+9));
  2195.             }
  2196.           } else {
  2197.             if(p.length === (code.length+7)) {
  2198.               formatted += '-'+(p.substring((code.length+6),(code.length+7)));
  2199.             } else {
  2200.               formatted += (p.substring((code.length+6),p.length));
  2201.             }
  2202.           }
  2203.         } else {
  2204.           if(p.length === (code.length+4) || p.length === (code.length+5)) {
  2205.             formatted += '-'+(p.substring((code.length+3),p.length));
  2206.           } else {
  2207.             formatted += (p.substring((code.length+3),p.length));
  2208.           }
  2209.         }
  2210.       } else {
  2211.         formatted += ' '+(p.substring(code.length,p.length));
  2212.       }
  2213.       input.value = formatted;
  2214.     }
  2215.   }
  2216. };
  2217.  
  2218. for(var i = 0; i < phone.input.length; i++) {
  2219.   phone.input[i].onkeydown = function(e) {
  2220.     var key = e.charCode || e.keyCode || 0;
  2221.     if(((key == 8 || key == 9 || key == 46 || (key >= 48 && key <= 57) || (key >= 96 && key <= 105)) && !e.shiftKey) || (key == 65 && e.ctrlKey)) {  
  2222.       if((key >= 48 && key <= 57) || (key >= 96 && key <= 105)) {
  2223.         phone.format(this);
  2224.       }
  2225.     } else {
  2226.       return false;
  2227.     }
  2228.   };
  2229.   phone.input[i].onkeyup = function() {
  2230.     if(phone.only_numbers(this.value).length > 12) {
  2231.       this.value = this.value.substring(0,(this.value.length-1));
  2232.     }
  2233.   };
  2234.   phone.input[i].onblur = function() {
  2235.     phone.format(this);
  2236.   };
  2237.   phone.input[i].onclick = function() {
  2238.     phone.format(this);
  2239.   };
  2240. }
  2241.  
  2242.  
  2243.  
  2244. jQuery("#register_submit").click(function(){
  2245.  
  2246. var client_name = jQuery('#client_name').val();
  2247. if(client_name == ""){
  2248. jQuery("#client_name").css("border-color" , "red");
  2249. jQuery("#client_name").focus();
  2250. return false;
  2251. }
  2252. else
  2253. {
  2254. jQuery("#client_name").css("border-color", "#dadada");
  2255. }
  2256.  
  2257. var reg_name = jQuery('#reg-name').val();
  2258. if(reg_name == ""){
  2259. jQuery("#reg-name").css("border-color" , "red");
  2260. jQuery("#reg-name").focus();
  2261. return false;
  2262. }
  2263. else
  2264. {
  2265. jQuery("#reg-name").css("border-color", "#dadada");
  2266. }
  2267.  
  2268. var business_name=jQuery('#business_name').val();
  2269. if(business_name==""){
  2270. jQuery("#business_name").css("border-color" , "red");
  2271. jQuery("#business_name").focus();
  2272. return false;
  2273. }
  2274. else
  2275. {
  2276. jQuery("#business_name").css("border-color", "#dadada");
  2277. }
  2278.  
  2279. var address_bar = jQuery('#address_bar').val();
  2280. if(address_bar ==""){
  2281. jQuery("#address_bar").css("border-color" , "red");
  2282. jQuery("#address_bar").focus();
  2283. return false;
  2284. }
  2285. else
  2286. {
  2287. jQuery("#address_bar").css("border-color", "#dadada");
  2288. }
  2289.  
  2290. if(document.getElementById("countryId").value == "")
  2291. {
  2292.    alert("Please select country value"); // prompt user
  2293.    document.getElementById("countryId").focus(); //set focus back to control
  2294.    return false;
  2295. }
  2296.  
  2297. if(document.getElementById("stateId").value == "")
  2298. {
  2299.    alert("Please select state value ");
  2300.    document.getElementById("stateId").focus();
  2301.    return false;
  2302. }
  2303.  
  2304. if(document.getElementById("cityId").value == "")
  2305. {
  2306.    alert("Please select city value");
  2307.    document.getElementById("cityId").focus();
  2308.    return false;
  2309. }
  2310.  
  2311. var coun= jQuery('#countryId :selected').val(); // or $(this).val()
  2312. //alert(coun);
  2313. if(coun == 'Canada'){
  2314.   var zip = jQuery('#zip').val();
  2315.   var reg = /^[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1} *\d{1}[A-Z]{1}\d{1}$/;
  2316.    if (zip == ""){jQuery("#zip").css("border-color" , "red");
  2317.   alert("*Zipcode required!");
  2318.   return false;
  2319.   }
  2320.   else if ((zip.length)< 6 || (zip.length)>6 ){jQuery("#zip").css("border-color" , "red");
  2321.   alert("*zipcode should only be 6 digits"); return false;
  2322.   }
  2323.   else if (!reg.test(zip)){
  2324.   alert("*zipcode should be in the format NLN LNL (Like K8N 3A3)");
  2325.   jQuery("#zip").css("border-color" , "red");
  2326.   return false;
  2327.   }
  2328.   else { jQuery("#zip").css("border-color" , "#dadada");
  2329. return true;
  2330.   }
  2331.  
  2332. }
  2333. if(coun == 'United States'){
  2334.   var zip = jQuery('#zip').val();
  2335.   var reg = /^\d{5}(-\d{4})?$/;
  2336.    if (zip == ""){
  2337.   jQuery("#zip").css("border-color" , "red");
  2338.   alert("*Zipcode required!");
  2339.   return false;
  2340.   }
  2341.   else if ((zip.length)< 5 || (zip.length)>5 ){jQuery("#zip").css("border-color" , "red");
  2342.   alert("*zipcode should only be 5 digits"); return false;
  2343.   }
  2344.   else if (!reg.test(zip)){
  2345.   alert("*zipcode should be numbers only");
  2346.   jQuery("#zip").css("border-color" , "red");
  2347.   return false;
  2348.   }
  2349.   else {jQuery("#zip").css("border-color" , "#dadada");
  2350.   }
  2351. }
  2352. else{
  2353.   var zip = jQuery('#zip').val();
  2354.   var reg = /(^\d{5}$)|(^\D{1}\d{1}\D{1}\s\d{1}\D{1}\d{1}$)/;
  2355.    if (zip == ""){jQuery("#zip").css("border-color" , "red");
  2356.   alert("*Zipcode required!");
  2357.   return false;
  2358.   }/*
  2359.   else if ((zip.length)< 5 || (zip.length)>5 ){jQuery("#zip").css("border-color" , "red");
  2360.   alert("*zipcode should only be 5 digits"); return false;
  2361.   }
  2362.   else if (!reg.test(zip)){
  2363.   alert("*zipcode should be numbers only");
  2364.   jQuery("#zip").css("border-color" , "red");
  2365.   return false;
  2366.   }*/
  2367.   else {jQuery("#zip").css("border-color" , "#dadada");
  2368.   }
  2369. }
  2370.  
  2371.  
  2372. var phone_address = jQuery('#phone_address').val();
  2373. if(phone_address == ""){
  2374.     jQuery(".PhoneErr").text("Phone Number is missing");
  2375. jQuery("#phone_address").css("border-color" , "red");
  2376. jQuery("#phone_address").focus();
  2377. return false;
  2378. }
  2379.  else {jQuery("#phone_address").css("border-color" , "#dadada");
  2380.   }
  2381.  
  2382.  
  2383.  var reg_email = $("#reg_email").val();
  2384. if(reg_email == ""){
  2385. jQuery("#reg_email").css("border-color" , "red");
  2386. jQuery("#reg_email").focus();
  2387. return false;
  2388. }
  2389. function IsEmail(email) {
  2390.   var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  2391.   return regex.test(email);
  2392. }
  2393. if(IsEmail(reg_email)) {
  2394.            // alert("valid");
  2395.             jQuery("#reg_email").css("border-color" , "rgb(225, 225, 225)");
  2396.            
  2397.         }
  2398.         else
  2399.         {
  2400.        
  2401.         jQuery("#reg_email").css("border-color" , "red");
  2402.         jQuery("#reg_email").focus();
  2403.         return false;
  2404.         }
  2405.  
  2406. var business_description  = jQuery('#business_description ').val();
  2407. if(business_description  == ""){
  2408. jQuery("#business_description ").css("border-color" , "red");
  2409. jQuery("#business_description ").focus();
  2410. return false;
  2411. }
  2412.  else {jQuery("#business_description ").css("border-color" , "#dadada");
  2413. }
  2414.  
  2415. var business_category = jQuery('#business_category').val();
  2416. if(business_category == ""){
  2417. jQuery("#business_category").css("border-color" , "red");
  2418. jQuery("#business_category").focus();
  2419. return false;
  2420. }
  2421.  else {jQuery("#business_category").css("border-color" , "#dadada");
  2422. }
  2423.  
  2424.   var email_account = jQuery('#email_account').val();
  2425. if(email_account == ""){
  2426. jQuery("#email_account").css("border-color" , "red");
  2427. jQuery("#email_account").focus();
  2428. return false;
  2429. }
  2430.  else {jQuery("#email_account").css("border-color" , "#dadada");
  2431. }
  2432.  
  2433.  
  2434. value = jQuery('#password').val();
  2435.         var length = value.length;
  2436.         if(length < 8) {
  2437.             alert("Gmail Password should be at least 8 characters");
  2438. jQuery("#password").css("border-color" , "red");
  2439. return false;
  2440.         }else if(length > 8){
  2441.   alert("only 8 characters allowed");
  2442. jQuery("#password").css("border-color" , "red");
  2443. return false;
  2444. }else{jQuery("#password").css("border-color" , "#dadada");}
  2445.  
  2446. });
  2447.  
  2448.  
  2449. /*
  2450. $(wrapper).on("click",".database_field", function(e){
  2451.         var label= $("#label").val();
  2452.             var mytext= $("#mytext").val();
  2453. jQuery.ajax({
  2454.     type:'POST',
  2455.     url:'http://www.seocheatguides.com/wp-content/plugins/Membership_dashborad/membership_fields.php',
  2456.     data:"label="+label+"&mytext="+mytext,
  2457.  
  2458.    success: function(result){
  2459.     alert(result);
  2460.  
  2461. }
  2462. });
  2463.      });*/
  2464.  
  2465.  
  2466.  jQuery(".delete_field").on("click", function(){
  2467. if (confirm("Are you sure you want to delete this row?"))
  2468.         {
  2469.        
  2470.  var delete_id = jQuery(this).attr('id');
  2471.  var name = jQuery(this).attr('name');
  2472.  var label = jQuery(this).attr('label');
  2473.  
  2474. jQuery.ajax({
  2475.     type:'POST',
  2476.     url:'http://www.seocheatguides.com/wp-content/plugins/Membership_dashborad/delete_extra_field.php?delete_id=' + delete_id + '&label='
  2477. + label +'&name=' + name,
  2478.     data:"delete_id="+delete_id,
  2479.  
  2480.     success: function(result){
  2481.  // alert(data);
  2482.    jQuery(this).remove();
  2483.     }
  2484.  
  2485.      });
  2486.     }
  2487. });
  2488.  
  2489.  
  2490. jQuery('.vfb-submit').attr('type','hidden');
  2491.  
  2492. jQuery("#register_submit").click(function(){
  2493. jQuery("#item-vfb-1").submit();
  2494. return true;
  2495. });
  2496.     });
  2497.  
  2498. </script>
  2499.  
  2500. <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  2501. <script type= "text/javascript" src = "plugins_url('countries.js')"></script>
  2502.  
  2503.  
  2504. <form class="form-horizontal" role="form" action="" method="POST" enctype="multipart/form-data" id="form_id">
  2505. <h2>General Business Information</h2>
  2506.     <div class="form-group">
  2507.        <label class="control-label col-sm-2"  for="client_number">Client Number</label>
  2508.           <div class="col-sm-7 register_Information">
  2509.             <input name="client_number" type="text" class="form-control login-field" value="<?php echo uniqid(); ?>" id="client_number" disabled="disabled"/>
  2510.         <input type="hidden" value="<?php echo uniqid(); ?>" />
  2511.     </div>
  2512.     </div>
  2513.  
  2514.     <!--div class="form-group">
  2515.        <label class="control-label col-sm-2 business_Information"  for="username">Business Name</label>
  2516.           <div class="col-sm-7 register_Information">
  2517.             <input name="reg_name" type="text" class="form-control business_Information" value="<?php echo(isset($_POST['reg_name']) ? $_POST['reg_name'] : null); ?>" placeholder="Username" id="reg-name"/>
  2518.     </div>
  2519.     </div-->
  2520.  
  2521.     <div class="form-group">
  2522.     <label class="control-label col-sm-2 business_Information" for="client_name">Client Contact Name</label>
  2523.       <div class="col-sm-7 register_Information">
  2524.         <input type="text" name="client_name" class="form-control business_Information" value="<?php echo(isset($_POST['client_name']) ? $_POST['client_name'] : null); ?>" id="client_name" PLaceholder="Clients Contact Name"/>
  2525.       </div>
  2526.     </div>
  2527.  
  2528.    <div class="form-group">
  2529.       <label class="control-label col-sm-2 business_Information" for="username">Business Name</label>
  2530.           <div class="col-sm-7 register_Information">
  2531.             <input name="reg_name" type="text" class="form-control business_Information" value="<?php echo(isset($_POST['reg_name']) ? $_POST['reg_name'] : null); ?>" placeholder="Business Name" id="reg-name"/>
  2532.     </div>
  2533.     </div>
  2534.  
  2535.    <div class="form-group">
  2536.       <label class="control-label col-sm-2 business_Information" for="address">Address</label>
  2537.         <div class="col-sm-7 register_Information">
  2538.             <input type="text" name="address" value="<?php echo(isset($_POST['address']) ? $_POST['address'] : null); ?>" class="form-control business_Information" id="address_bar" PLaceholder="Address"/>
  2539.        </div>
  2540.    </div>
  2541.  
  2542. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  2543. <script src="http://lab.iamrohit.in/js/location.js"></script>
  2544.  
  2545. <div class="form-group">
  2546.       <label class="control-label col-sm-2 business_Information" for="country">Country</label>
  2547.         <div class="col-sm-7 register_Information">
  2548.            <select name="country" class="countries business_Information" id="countryId" required>
  2549. <option value="">Select Country</option>
  2550. </select>
  2551.        </div>
  2552.    </div>
  2553.  
  2554.  <div class="form-group">
  2555.       <label class="control-label col-sm-2 business_Information" for="state">State/Province</label>
  2556.         <div class="col-sm-7 register_Information">
  2557.           <select name="state" class="states business_Information" id="stateId" required>
  2558. <option value="">Select State</option>
  2559. </select>
  2560.        </div>
  2561.    </div>
  2562.  
  2563.    <div class="form-group">
  2564.       <label class="control-label col-sm-2 business_Information" for="city">City</label>
  2565.         <div class="col-sm-7 register_Information">
  2566.            <select name="city" class="cities business_Information" id="cityId" required>
  2567. <option value="">Select City</option></select>
  2568.  
  2569.        </div>
  2570.    </div>
  2571.  
  2572.    <div class="form-group">
  2573.       <label class="control-label col-sm-2 business_Information" for="zip">Zip/Postal Code</label>
  2574.         <div class="col-sm-7 register_Information">
  2575.             <input type="text" name="zip_code" class="form-control business_Information" value="<?php echo(isset($_POST['zip_code']) ? $_POST['zip_code'] : null); ?>" id="zip" PLaceholder="Zip Code"/><span class="errorMessage" onkeypress="keypress_example()"></span>
  2576.        </div>
  2577.    </div>
  2578.  
  2579.    <div class="form-group">
  2580.       <label class="control-label col-sm-2 business_Information" for="phone_number">Phone Number</label>
  2581.         <div class="col-sm-7 register_Information">
  2582.             <input type="text" name="phone_address" class="form-control business_Information" value="<?php echo(isset($_POST['phone_address']) ? $_POST['phone_address'] : null); ?>" id="phone_address" placeholder="Phone Address"/>
  2583.        </div><div class="PhoneErr"> </div>
  2584.        
  2585.    </div>
  2586.  
  2587.    <div class="form-group">
  2588.       <label class="control-label col-sm-2 business_Information" for="email">Client Info Email</label>
  2589.         <div class="col-sm-7 register_Information">
  2590.             <input type="text" name="reg_email" class="form-control business_Information" value="<?php echo(isset($_POST['reg_email']) ? $_POST['reg_email'] : null); ?>" id="reg_email"  placeholder="Enter Your Email Address"/>
  2591.        </div>
  2592.    </div>
  2593.    
  2594. <div class="form-group">
  2595.       <label class="control-label col-sm-2 business_Information" for="business_description">Business Description</label>
  2596.         <div class="col-sm-7 register_Information">
  2597.             <input type="text" name="business_description" value="<?php echo(isset($_POST['business_description']) ? $_POST['business_description'] : null); ?>" class="form-control business_Information" id="business_description" Placeholder="Business Description"/>
  2598.        </div>
  2599.    </div>
  2600.  
  2601.   <div class="form-group">
  2602.       <label class="control-label col-sm-2 business_Information" for="business_category">Business Category</label>
  2603.         <div class="col-sm-7 register_Information">
  2604.             <input type="text" name="business_category" value="<?php echo(isset($_POST['business_category']) ? $_POST['business_category'] : null); ?>" class="form-control business_Information" id="business_category" Placeholder="Business Category"/>
  2605.        </div>
  2606.    </div>
  2607.    
  2608.    <div class="form-group">
  2609.       <label class="control-label col-sm-2 business_Information" for="url">Client Website URL</label>
  2610.         <div class="col-sm-7 register_Information">
  2611.             <input type="text" name="url_address" value="<?php echo(isset($_POST['url_address']) ? $_POST['url_address'] : null); ?>" class="form-control business_Information" id="url_address" placeholder="Url Address"/>
  2612.        </div>
  2613.    </div>
  2614.  
  2615. <div class="form-group">
  2616.  <label class="control-label col-sm-2" for="url">Hours Operation:</label>
  2617. <div class="head_sec">
  2618. <div> Open </div>
  2619. <div> close </div>
  2620. </div>
  2621.  
  2622.  
  2623. <div name="body_sec" class="body_sec">
  2624.  
  2625.  <?php
  2626.  
  2627. $openTimes = "<option value=\"06:00\">6:00 AM</option>
  2628. <option value=\"06:30\">6:30 AM</option>
  2629. <option value=\"07:00\">7:00 AM</option>
  2630. <option value=\"07:30\">7:30 AM</option>
  2631. <option value=\"08:00\">8:00 AM</option>
  2632. <option value=\"08:30\">8:30 AM</option>
  2633. <option value=\"09:00\" selected>9:00 AM</option>
  2634. <option value=\"09:30\">9:30 AM</option>
  2635. <option value=\"10:00\">10:00 AM</option>
  2636. <option value=\"10:30\">10:30 AM</option>
  2637. <option value=\"11:00\">11:00 AM</option>
  2638. <option value=\"11:30\">11:30 AM</option>
  2639. <option value=\"12:00\">12:00 PM</option>
  2640. <option value=\"12:30\">12:30 PM</option>
  2641. <option value=\"13:00\">1:00 PM</option>
  2642. <option value=\"13:30\">1:30 PM</option>
  2643. <option value=\"14:00\">2:00 PM</option>
  2644. <option value=\"14:30\">2:30 PM</option>
  2645. <option value=\"15:00\">3:00 PM</option>
  2646. <option value=\"15:30\">3:30 PM</option>
  2647. <option value=\"16:00\">4:00 PM</option>
  2648. <option value=\"16:30\">4:30 PM</option>
  2649. <option value=\"17:00\">5:00 PM</option>
  2650. <option value=\"17:30\">5:30 PM</option>
  2651. <option value=\"18:00\">6:00 PM</option>
  2652. <option value=\"18:30\">6:30 PM</option>
  2653. <option value=\"19:00\">7:00 PM</option>
  2654. <option value=\"19:30\">7:30 PM</option>
  2655. <option value=\"20:00\">8:00 PM</option>
  2656. <option value=\"20:30\">8:30 PM</option>
  2657. <option value=\"21:00\">9:00 PM</option>
  2658. <option value=\"21:30\">9:30 PM</option>
  2659. <option value=\"22:00\">10:00 PM</option>";
  2660.  
  2661. $closeTimes = "<option value=\"06:00\">6:00 AM</option>
  2662. <option value=\"06:30\">6:30 AM</option>
  2663. <option value=\"07:00\">7:00 AM</option>
  2664. <option value=\"07:30\">7:30 AM</option>
  2665. <option value=\"08:00\">8:00 AM</option>
  2666. <option value=\"08:30\">8:30 AM</option>
  2667. <option value=\"09:00\">9:00 AM</option>
  2668. <option value=\"09:30\">9:30 AM</option>
  2669. <option value=\"10:00\">10:00 AM</option>
  2670. <option value=\"10:30\">10:30 AM</option>
  2671. <option value=\"11:00\">11:00 AM</option>
  2672. <option value=\"11:30\">11:30 AM</option>
  2673. <option value=\"12:00\">12:00 PM</option>
  2674. <option value=\"12:30\">12:30 PM</option>
  2675. <option value=\"13:00\">1:00 PM</option>
  2676. <option value=\"13:30\">1:30 PM</option>
  2677. <option value=\"14:00\">2:00 PM</option>
  2678. <option value=\"14:30\">2:30 PM</option>
  2679. <option value=\"15:00\">3:00 PM</option>
  2680. <option value=\"15:30\">3:30 PM</option>
  2681. <option value=\"16:00\">4:00 PM</option>
  2682. <option value=\"16:30\">4:30 PM</option>
  2683. <option value=\"17:00\" selected>5:00 PM</option>
  2684. <option value=\"17:30\">5:30 PM</option>
  2685. <option value=\"18:00\">6:00 PM</option>
  2686. <option value=\"18:30\">6:30 PM</option>
  2687. <option value=\"19:00\">7:00 PM</option>
  2688. <option value=\"19:30\">7:30 PM</option>
  2689. <option value=\"20:00\">8:00 PM</option>
  2690. <option value=\"20:30\">8:30 PM</option>
  2691. <option value=\"21:00\">9:00 PM</option>
  2692. <option value=\"21:30\">9:30 PM</option>
  2693. <option value=\"22:00\">10:00 PM</option>";
  2694. ?>
  2695. <div class="body_sec_inner">
  2696. <div class="col-sm-7">
  2697. <label class="hours">Mon: </label>
  2698. <select name="from"  id="from">
  2699.     <?php echo $openTimes; ?>
  2700. </select>
  2701. <select name="to"  id="to">
  2702.     <?php echo $closeTimes; ?>
  2703. </select>
  2704.  
  2705. </div>
  2706. <div class="col-sm-7">
  2707. <label class="hours">Thes: </label>
  2708. <select name="from"  id="from">
  2709.     <?php echo $openTimes; ?>
  2710. </select>
  2711.  
  2712. <select name="to"  id="to">
  2713.     <?php echo $closeTimes; ?>
  2714. </select></div>
  2715.  
  2716. <div class="col-sm-7">
  2717. <label class="hours">wed: </label>
  2718. <select name="from"  id="from">
  2719.     <?php echo $openTimes; ?>
  2720. </select>
  2721. <select name="to"  id="to">
  2722.     <?php echo $closeTimes; ?>
  2723. </select></div>
  2724.  
  2725. <div class="col-sm-7">
  2726. <label class="hours">Thurs: </label>
  2727. <select name="from"  id="from">
  2728.     <?php echo $openTimes; ?>
  2729. </select>
  2730. <select name="to"  id="to">
  2731.     <?php echo $closeTimes; ?>
  2732. </select></div>
  2733.  
  2734. <div class="col-sm-7">
  2735. <label class="hours">Fri: </label>
  2736. <select name="from"  id="from">
  2737.     <?php echo $openTimes; ?>
  2738. </select>
  2739. <select name="to"  ilabeld="to">
  2740.     <?php echo $closeTimes; ?>
  2741. </select></div>
  2742.  
  2743. <div class="col-sm-7">
  2744. <label class="hours">Sat: </label>
  2745. <select name="from"  id="from">
  2746.     <?php echo $openTimes; ?>
  2747. </select>
  2748. <select name="to"  id="to">
  2749.     <?php echo $closeTimes; ?>
  2750. </select></div>
  2751.  
  2752. <div class="col-sm-7">
  2753. <label class="hours">Sun: </label>
  2754. <select name="from"  id="from">
  2755.     <?php echo $openTimes; ?>
  2756. </select>
  2757. <select name="to"  id="to">
  2758.     <?php echo $closeTimes; ?>
  2759. </select></div>
  2760. </div>
  2761. </div></div>
  2762.  
  2763. <style>
  2764. .inside1 .activity-block {
  2765.   float: left;
  2766.   width: 100%;
  2767. }
  2768.  
  2769. .body_sec_inner {
  2770.    float: right;
  2771.     width: 75%;
  2772. }
  2773. .body_sec_inner label {
  2774.   float: left;
  2775.   text-align: center;
  2776.   width: 15%;
  2777. }
  2778.  
  2779. .body_sec_inner > input {
  2780.   border: 1px solid #ccc;
  2781.   float: left;
  2782.   margin: 0;
  2783.   width: 16%;
  2784. }
  2785.  
  2786. .head_sec {
  2787.   float: right;
  2788.   width: 67%;
  2789. }
  2790.    
  2791. .head_sec div {
  2792.   float: left;
  2793.   padding: 5px 0;
  2794.   text-align: center;
  2795.   width: 12%;
  2796. }
  2797. .inside1 .activity-block {
  2798.   border:none;
  2799.   margin: 0 -12px;
  2800.   padding:0px;
  2801. }
  2802. .countries {
  2803.     margin-left: 115px;
  2804. }
  2805. .states {
  2806.     margin-left: 115px;
  2807. }
  2808. .cities {
  2809.     margin-left: 115px;
  2810. }
  2811. .pmpro_asterisk{float: right;width: auto;}
  2812. .form-horizontal .col-sm-7 input{float:left; width: 78%;}
  2813. .col-sm-7.next_lab.register_Information {
  2814.     width: 30%;
  2815. }
  2816. .col-sm-7.upper_lab.register_Information {
  2817.     width: 40%;
  2818. }
  2819. .col-sm-7.pre_lab.register_Information {
  2820.     width: 34%;
  2821. }
  2822. #stateId {
  2823.     width: 63%;
  2824. }
  2825. #cityId {
  2826.     width: 63%;
  2827. }
  2828. #label {
  2829.     margin-left: 30px;
  2830. }
  2831. #mytext {
  2832.     margin-bottom: 6px;
  2833.     margin-left: 100px;
  2834.     width: 45%;
  2835. }
  2836. .vfb-legend h3 {
  2837.     display: none;
  2838. }
  2839. .input_fields_wrap #form_success {
  2840.     font-size: 18px;
  2841.     text-align: center;
  2842. }
  2843. .intro_submit {
  2844.   display: inline-block;
  2845.   float: none;
  2846.   margin: 0 !important;
  2847.   padding: 0 20px 0 25px;
  2848.   width: 834px;
  2849. }
  2850. .intro_submit:hover {
  2851.   background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
  2852.   border: medium none;
  2853. }
  2854. .intro_submit fieldset ul {
  2855.   float: left;
  2856.   width: 100%;
  2857. }
  2858. .intro_submit fieldset ul li {
  2859.   float: left;
  2860.   width: 100%;
  2861.   margin-bottom: 37px;
  2862. }
  2863. .intro_submit fieldset ul li label {
  2864.   float: left;
  2865.   width: 34.5%;
  2866. }
  2867. .intro_submit fieldset ul li input {
  2868.     border-radius: 4px;
  2869.     box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07) inset;
  2870.     float: left;
  2871.     font-size: 14px;
  2872.     height: 34px;
  2873.     padding: 6px 12px;
  2874.     width: 55.5%;
  2875. }
  2876. .intro_submit fieldset ul li div {
  2877.   float: left;
  2878.   width: 63.5%;
  2879. }
  2880. .intro_submit fieldset ul li div textarea {
  2881.   float: left;
  2882.   width: 100%;
  2883.   height: 100px;
  2884. }
  2885. .intro_submit fieldset ul li div span {
  2886.   float: left;
  2887.   margin: 0 15px 0 0;
  2888.   width: auto;
  2889. }
  2890. .intro_submit fieldset ul li div span input {
  2891.   float: left;
  2892.   margin: 2px 0;
  2893.   width: auto;
  2894. }
  2895. .intro_submit fieldset ul li div span label {
  2896.   float: left;
  2897.   margin: 0;
  2898.   width: auto;
  2899. }
  2900. .form-horizontal .control-label {
  2901.     margin-bottom: 0;
  2902.     padding-left: 32px;
  2903.     padding-top: 7px;
  2904.     text-align: left;
  2905. }
  2906. #register_submit.btn-primary {
  2907.     background-color: #0073aa;
  2908.     border-color: #0073aa;
  2909.     color: #fff;
  2910.     font-size: 18px;
  2911. }
  2912. </style>
  2913.  
  2914.     <div class="form-group">
  2915.       <label class="control-label col-sm-2" for="file_upload">Upload Client Logo File</label>
  2916.         <div class="col-sm-7">
  2917.             <input type="file" name="file_upload" class="form-control" id="file_upload" placeholder=" Client Logo "/>
  2918.        </div>
  2919.    </div>
  2920.  
  2921.  
  2922.   <h2> Client Account Information </h2>
  2923.  
  2924.    <div class="form-group">
  2925.       <label class="control-label col-sm-2" for="email_account">Gmail Login</label>
  2926.         <div class="col-sm-7">
  2927.             <input type="text" name="email_account" class="form-control" value="<?php echo(isset($_POST['email_account']) ? $_POST['email_account'] : null); ?>" id="email_account" placeholder="Email address"/>
  2928.        </div>
  2929.    </div>
  2930.  
  2931.  
  2932.    <div class="form-group">
  2933.       <label class="control-label col-sm-2" for="password">Gmail Password</label>
  2934.         <div class="col-sm-7">
  2935.             <input type="password" name="gmail_password" value="<?php echo(isset($_POST['gmail_password']) ? $_POST['gmail_password'] : null); ?>" class="form-control" id="password" Placeholder="Email Password"/>
  2936.        </div>
  2937.    </div>
  2938.  
  2939.       <div class="form-group">
  2940.       <label class="control-label col-sm-2" for="url">Gmail URL</label>
  2941.         <div class="col-sm-7">
  2942.             <input type="text" name="gmail_url" value="<?php echo(isset($_POST['gmail_url']) ? $_POST['gmail_url'] : null); ?>" class="form-control" id="password" Placeholder="Gmail URL"/>
  2943.        </div>
  2944.    </div>
  2945.    
  2946.     <!--div class="form-group">
  2947.       <label class="control-label col-sm-2" for="facebook_login">Facebook Login</label>
  2948.         <div class="col-sm-7">
  2949.             <input type="text" name="facebook_login" class="form-control" value="<?php //echo(isset($_POST['facebook_login']) ? $_POST['facebook_login'] : null); ?>" id="facebook_login" placeholder="Facebook Login"/>
  2950.        </div>
  2951.    </div>
  2952.  
  2953.    <div class="form-group">
  2954.       <label class="control-label col-sm-2" for="facebook_password">Facebook Password</label>
  2955.         <div class="col-sm-7">
  2956.             <input type="password" name="facebook_password" value="<?php //echo(isset($_POST['facebook_password']) ? $_POST['facebook_password'] : null); ?>" class="form-control" id="facebook_password" Placeholder="Facebook Password"/>
  2957.        </div>
  2958.    </div>
  2959.  
  2960.    <div class="form-group">
  2961.       <label class="control-label col-sm-2" for="Facebook_URL">Facebook URL</label>
  2962.         <div class="col-sm-7">
  2963.             <input type="text" name="facebook_url" value="<?php //echo(isset($_POST['facebook_url']) ? $_POST['facebook_url'] : null); ?>" class="form-control" id="facebook_url" Placeholder="Facebook URL"/>
  2964.        </div>
  2965.    </div>  
  2966.    
  2967.       <div class="form-group">
  2968.       <label class="control-label col-sm-2" for="twitter_login">Twitter Username</label>
  2969.         <div class="col-sm-7">
  2970.             <input type="text" name="twitter_login" class="form-control" value="<?php //echo(isset($_POST['twitter_login']) ? $_POST['twitter_login'] : null); ?>" id="twitter_login" placeholder="Twitter Login"/>
  2971.        </div>
  2972.    </div>
  2973.  
  2974.    <div class="form-group">
  2975.       <label class="control-label col-sm-2" for="twitter_password">Twitter Password</label>
  2976.         <div class="col-sm-7">
  2977.             <input type="password" name="twitter_password" value="<?php// echo(isset($_POST['twitter_password']) ? $_POST['twitter_password'] : null); ?>" class="form-control" id="twitter_password" Placeholder="Twitter Password"/>
  2978.        </div>
  2979.    </div>
  2980.  
  2981.    <div class="form-group">
  2982.       <label class="control-label col-sm-2" for="YouTube_login">YouTube Login</label>
  2983.         <div class="col-sm-7">
  2984.             <input type="text" name="youtube_login" class="form-control" value="<?php //echo(isset($_POST['YouTube_login']) ? $_POST['YouTube_login'] : null); ?>" id="youtube_login" placeholder="YouTube Login"/>
  2985.        </div>
  2986.    </div>
  2987.  
  2988.    <div class="form-group">
  2989.       <label class="control-label col-sm-2" for="youtube_password">YouTube Password</label>
  2990.         <div class="col-sm-7">
  2991.             <input type="password" name="youtube_password" value="<?php// echo(isset($_POST['youtube_password']) ? $_POST['youtube_password'] : null); ?>" class="form-control" id="youtube_password" Placeholder="YouTube Password"/>
  2992.        </div>
  2993.    </div>
  2994.  
  2995.    <div class="form-group">
  2996.       <label class="control-label col-sm-2" for="control_panel">Cpanel Url</label>
  2997.         <div class="col-sm-7">
  2998.             <input type="text" name="control_panel" value="<?php //echo(isset($_POST['control_panel']) ? $_POST['control_panel'] : null); ?>" class="form-control" id="control_panel" placeholder="Cpanel Url"/>
  2999.        </div>
  3000.    </div>
  3001.  
  3002.  <div class="form-group">
  3003.       <label class="control-label col-sm-2" for="cpanel_login">Cpanel Login</label>
  3004.         <div class="col-sm-7">
  3005.             <input type="text" id="cpanel_login"ytext3 name="cpanel_login" class="form-control" id="cpanel_login" value="<?php echo(isset($_POST['cpanel_login']) ? $_POST['cpanel_login'] : null); ?>" placeholder="Cpanel Login Url"/>
  3006.        </div>
  3007.    </div>
  3008.  
  3009.  <div class="form-group">
  3010.       <label class="control-label col-sm-2" for="pass"> Cpanel Pass</label>
  3011.         <div class="col-sm-7">
  3012.             <input type="password" name="cpanel_password" class="form-control" value="<?php //echo(isset($_POST['cpanel_password']) ? $_POST['cpanel_password'] : null); ?>" id="cpanel_password" Placeholder="Cpanel Password"/>
  3013.        </div>
  3014.    </div>
  3015.  
  3016.     <div class="form-group">
  3017.       <label class="control-label col-sm-2" for="wordpress_url">Wordpress URL</label>
  3018.         <div class="col-sm-7">
  3019.             <input type="text" name="wordpress_url" class="form-control" value="<?php //echo(isset($_POST['wordpress_url']) ? $_POST['wordpress_url'] : null); ?>" id="wordpress_url" Placeholder="Wordpress URL"/>
  3020.        </div>
  3021.    </div>
  3022.    
  3023.  <div class="form-group">
  3024.       <label class="control-label col-sm-2" for="wordpress_login">Wordpress Login</label>
  3025.         <div class="col-sm-7">
  3026.             <input type="text" name="wordpress_login" class="form-control" value="<?php //echo(isset($_POST['wordpress_login']) ? $_POST['wordpress_login'] : null); ?>" id="wordpress_login" Placeholder="Wordpress Login"/>
  3027.        </div>
  3028.    </div>
  3029.  
  3030.  <div class="form-group">
  3031.       <label class="control-label col-sm-2" for="wordpress_password"> Wordpress Password</label>
  3032.         <div class="col-sm-7">
  3033.             <input type="password" name="wordpress_password" value="<?php //echo(isset($_POST['wordpress_password']) ? $_POST['wordpress_password'] : null); ?>" class="form-control" id="wordpress_password" placeholder="Wordpress Password"/>
  3034.        </div>
  3035.    </div-->
  3036.  
  3037. <div class="form-group intro_submit">
  3038. <div class="input_fields_wrap">
  3039.      <div class="more_content"></div>
  3040.  
  3041.  
  3042. <?php
  3043.  
  3044. if(isset($_POST['reg_submit'])){
  3045.  
  3046.     $user_name = $_POST['reg_name'];
  3047.     $usr_nme  = preg_replace('/\s+/', '',$user_name);
  3048.     $username = strtolower($usr_nme);
  3049.     $client_key =  uniqid()."_".$username;
  3050.     $clt_nme = $_POST['client_name'];
  3051.     $client_nme =   preg_replace('/\s+/', '',$clt_nme);
  3052.     $client_name = strtolower($client_nme);
  3053.     //$business_name = $_POST['business_name'];
  3054.     $address = $_POST['address'];
  3055.     $country = $_POST['country'];
  3056.     $state = $_POST['state'];
  3057.     $city = $_POST['city'];
  3058.     $zip_code = $_POST['zip_code'];
  3059.     $phone_address = $_POST['phone_address'];
  3060.     $reg_email = $_POST['reg_email'];
  3061.     $business_description = $_POST['business_description'];
  3062.     $business_category = $_POST['business_category'];
  3063.     $url_address = $_POST['url_address'];
  3064.     $file_upload = $_FILES["fileToUpload"]["name"];
  3065.     $hours_from = $_POST["from"];
  3066.     $hours_to = $_POST['to'];
  3067.     $email_account = $_POST['email_account'];
  3068.     $gmail_url = $_POST['gmail_url'];
  3069.     $email_password = MD5($_POST['gmail_password']);
  3070.    
  3071.     global $wpdb;
  3072.     $username = sanitize_text_field( $username );
  3073.     $userss = "SELECT * FROM wpmw_users WHERE user_login = '$username'";
  3074.     $result_users = mysql_query($userss);
  3075.    
  3076.     $result_num = mysql_num_rows($result_users);
  3077.     if ($result_num != 0){
  3078.        
  3079.     echo "Username in Use, Try Something New!!!";
  3080.     exit;
  3081.     }
  3082.     else{
  3083.  
  3084.     $id = get_current_user_id();
  3085.     $table_name = $wpdb->prefix . "users";
  3086.  
  3087.     $userdata = $wpdb->query('Insert into '.$table_name.' (user_nicename,user_email,user_login,user_pass,user_registered, user_status, display_name,user_employee,user_client,current_client_user_id) values("'.$username.'","'.$reg_email.'","'.$client_name.'","'.$email_password.'","'.$time.'", "0", "'.$client_name.'","0","1","'.$id.'")');
  3088.     $lastid = $wpdb->insert_id;
  3089.     $_SESSION['lastid'] = $lastid;
  3090.     $register_user = wp_insert_user( $userdata );
  3091.    
  3092.     $wp_sql = "select * from $table_name order by id desc limit 0,1";
  3093.     $query = mysql_query($wp_sql);
  3094.     $fetch = mysql_fetch_array($query);
  3095.     $user_id = $fetch["ID"];
  3096.     $capa1 = 'a:1:{s:11:"contributor";b:1;}';
  3097.     $wpdb->query("INSERT INTO wpmw_usermeta (umeta_id,user_id,meta_key,meta_value) VALUES ( NULL,'$user_id','wpmw_capabilities','$capa1' )");
  3098.  
  3099.     add_user_meta( $user_id, 'client_contact_number', $client_key);
  3100.     add_user_meta( $user_id, 'current_user_id', $id);
  3101.     add_user_meta( $user_id, 'client_name', $client_name);
  3102.     add_user_meta( $user_id, 'business_name', $username);
  3103.     add_user_meta( $user_id, 'address', $address);
  3104.     add_user_meta( $user_id, 'country', $country);
  3105.     add_user_meta( $user_id, 'state', $state);
  3106.     add_user_meta( $user_id, 'city', $city);
  3107.     add_user_meta( $user_id, 'zip_code', $zip_code);
  3108.     add_user_meta( $user_id, 'phone_address', $phone_address);
  3109.     add_user_meta( $user_id, 'reg_email', $reg_email);
  3110.     add_user_meta( $user_id, 'business_description', $business_description);
  3111.     add_user_meta( $user_id, 'business_category', $business_category);
  3112.     add_user_meta( $user_id, 'hours_from', $hours_from);
  3113.     add_user_meta( $user_id, 'hours_to', $hours_to);
  3114.     add_user_meta( $user_id, 'url_address', $url_address);
  3115.     add_user_meta( $user_id, 'email_account', $email_account);
  3116.     add_user_meta( $user_id, 'gmail_url', $gmail_url);
  3117.     add_user_meta( $user_id, 'gmail_password', $email_password);
  3118.  
  3119.     if(!$userdata){
  3120.  mysql_error(); }
  3121. }
  3122. }
  3123.  echo do_shortcode("[vfb id='1']");
  3124.  
  3125.  ?>
  3126. <div class="col-sm-offset-2 col-sm-10 " style="background-color:none repeat scroll 0 0 #3fc1a8 color:#fff; width: 26.667%; margin-left: 33.667%;">
  3127. <input type="submit"  class="btn btn-primary" name="reg_submit" id="<?php echo $user_id; ?>register_submit" value="Add Client" onclick="IsValidZipCode(this.form.zip.value)"/>
  3128.  
  3129. </div>
  3130. </div>
  3131. </div>
  3132.  
  3133. </form>
  3134. <?php
  3135. }
  3136.  $sess_id = $_SESSION['lastid'];  
  3137. ?>
Add Comment
Please, Sign In to add comment