function getShortcode($url) { $shortcode = ''; $query = OCP\DB::prepare('SELECT shortcode FROM *PREFIX*shorten WHERE url=?'); $results = $query->execute(Array($url))->fetchAll(); if ($results) { foreach($results as $result) { $shortcode = $result['shortcode']; } } if ($shortcode == "") { $shortcode = rand_chars(6); $found = true; while ($found) { $query = OCP\DB::prepare('SELECT id FROM *PREFIX*shorten WHERE shortcode=?'); $results = $query->execute(Array($shortcode))->fetchAll(); if (!$results) { $found = false; $uid = \OCP\User::getUser(); $query = OCP\DB::prepare('INSERT INTO *PREFIX*shorten (uid, shortcode, url) VALUES (?,?,?)'); $query->execute(Array($uid,$shortcode,$url)); $id = OCP\DB::insertid('*PREFIX*shorten'); } else $shortcode = rand_chars(6); } } return $shortcode; }
$name = $file['name']; $email = $file['email']; $phone = $file['phone']; $password = $file['password']; $security_q = $file['security_q']; $security_a = $file['security_a']; $lname = $file['lastname']; $gen = $file['gender']; $city = $file['city']; //INSERT DATA INTO VERIFIED DOCTORS TABLE mysql_query("insert into doctor_detail\r\n\r\n(`id`,`pic`,`name`,`email`,`phone`,`password`,`security_q`,`security_a`,`status`,`lastname`,\r\n`address`,`gender`,`speciality`,`department`,`facebook`,`twitter`,`linkedin`,`googleplus`,`myweb`,`myclinic`,`city`)\r\nVALUES('NULL','NULL','{$name}','{$email}','{$phone}','{$password}','{$security_q}','{$security_a}','1','{$lname}','NULL','{$gen}',\r\n'NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','{$city}') ") or die(mysql_error() . "lxz"); //SET LOGIN FOR THIS USER $seler = mysql_query("select id from doctor_detail where password='******' AND email='{$clientemail}' ") or die(mysql_error()); $dic = mysql_fetch_row($seler); $docid = $dic[0]; $Token = rand_chars("ABCEDFGhijklmnopqrst1234567890", 20); mysql_query("insert into doctor_login values('{$docid}','{$email}','{$password}','','{$Token}')") or die(mysql_error() . "poll"); //DALETE DATA FROM TMP TABLE mysql_query("delete from tmp_table where id='{$id}' AND email='{$email}'") or die(mysql_error() . "oops"); // // login_data($docid,$email,$password,$Token); /////////////////My Mailing System Start Here////////////////////////////////////// $mail = new PHPMailer(); $mail->IsSMTP(); // Set mailer to use SMTP $mail->Host = 'smtpout.secureserver.net'; // Specify main and backup server $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = '******'; // SMTP username
// Set email format to HTML $mail->Subject = 'Your Medical Documents'; $mail->Body = 'You have new medical document login with your email and password <a href="http://entspecialistnoida.com/docs/index.php">Click Here to login</a>'; $mail->AltBody = 'You have new medical document login with your email and password <a href="http://entspecialistnoida.com/docs/index.php">Click Here to login</a>'; if (!$mail->Send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; exit; } echo 'Message has been sent <a href="doctorhome.php">Home</a>'; //////////////////////////////My Mailing System End Here////////////////////////////// exit; } $Token = rand_chars("AaBbCcEeDdFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtuUvVWWxXYZyz1234567890", 54); mysql_query("insert into client_login VALUES('','{$clientemail}','{$clintpassword}','','{$Token}')") or die(mysql_error()); $rtrt = mysql_query("select * from client_login where con_id='{$Token}'") or die(mysql_error() . "There is an ERROR"); $erty = mysql_fetch_array($rtrt); $conid = $erty['con_id']; echo $clientid = $erty['client_id']; echo $eml = $erty['username']; $rtrt2 = mysql_query("select client_phone from mydocs where cod='{$Token}'") or die(mysql_error() . "F**K OFF"); $erty2 = mysql_fetch_array($rtrt); echo $phn = $erty2[0]; require_once 'data_handler.php'; patient_profile($clientid, $eml, $phn, $Token); /////////////////My Mailing System Start Here////////////////////////////////////// $mail = new PHPMailer(); $mail->IsSMTP(); // Set mailer to use SMTP
function display_pb_forms($atts) { global $wpdb; if (isset($_POST['action']) && $_POST['action'] == "update_request") { //UPDATE REQUEST $req_id = $_POST['req_id']; $anon = isset($_POST['anon']) && $_POST['anon'] == 'on' ? 1 : 0; $notify = isset($_POST['notify']) && $_POST['notify'] == 'on' ? 1 : 0; if (isset($_POST['closed']) && $_POST['closed'] == 'on') { $closed = time(); $active = 2; $wpdb->update($wpdb->prefix . 'pb_requests', array('anon' => $anon, 'closed' => $closed, 'notify' => $notify, 'active' => $active), array('id' => $req_id)); } else { $wpdb->update($wpdb->prefix . 'pb_requests', array('anon' => $anon, 'notify' => $notify), array('id' => $req_id)); } $updated_title = isset($closed) ? PB_REQ_CLOSED_TITLE : PB_REQ_UPDATED_TITLE; $updated_msg = isset($closed) ? PB_REQ_CLOSED_MSG : PB_REQ_UPDATED_MSG; $updated_request_output = "<div id='praybox_wrapper'>"; $updated_request_output .= "<h2 class='pbx-title'>{$updated_title}</h2>"; $updated_request_output .= "<p class='pbx-text'>{$updated_msg}</p>"; $updated_request_output .= "</div>"; return $updated_request_output; } elseif (isset($_POST['action']) && $_POST['action'] == "submit_request") { //Submit Request to DB, Email Mgmt Link, and Display a Message $first_name = isset($_POST['first_name']) && $_POST['first_name'] != "" ? clean($_POST['first_name']) : "anon"; $last_name = isset($_POST['last_name']) && $_POST['last_name'] != "" ? clean($_POST['last_name']) : "anon"; $anon = isset($_POST['anon']) && $_POST['anon'] == 'on' ? 1 : 0; $email = $_POST['email']; $authcode = rand_chars(); $title = clean($_POST['title']); $body = clean($_POST['body']); $notify = isset($_POST['notify']) && $_POST['notify'] == 'on' ? 1 : 0; $ip_address = $_SERVER['REMOTE_ADDR']; $time_now = time(); if (get_option('pb_admin_moderation') == 1) { $active = 0; } else { $active = 1; } //THROW FLAGS IF ANY OF THESE CONDITIONS ARE MET if (isIPBanned($ip_address) == "fail" || isDuplicate($first_name, $last_name, $email, $title, $ip_address) == "fail") { $flaggit = 1; } else { $flaggit = 0; } //IF NO FLAGS, RUN IT if ($flaggit == 0) { $site_name = get_bloginfo('name'); $wpdb->insert($wpdb->prefix . 'pb_requests', array('first_name' => $first_name, 'last_name' => $last_name, 'anon' => $anon, 'email' => $email, 'authcode' => $authcode, 'submitted' => $time_now, 'title' => $title, 'body' => $body, 'notify' => $notify, 'ip_address' => $ip_address, 'active' => $active)); $management_url = getManagementUrl($authcode); $email_from = get_option('pb_reply_to_email'); $email_message = get_option('pb_email_prefix'); $email_message .= "\n\n" . PB_REQ_EMAIL_MSG1 . " {$management_url}\n\n" . PB_REQ_EMAIL_MSG2 . "\n\n"; $email_message .= get_option('pb_email_suffix'); $headers = 'Reply-To:' . $site_name . ' <' . $email_from . '>' . "\r\n"; $headers .= 'From:' . $site_name . ' <' . $email_from . '>' . "\r\n"; wp_mail($email, PB_REQ_EMAIL_SUBJECT, $email_message, $headers); $submitted_output = "<div id='praybox_wrapper'>"; $submitted_output .= "<h2 class='pbx-title'>" . PB_REQ_SUBMITTED_TITLE . "</h2>"; $submitted_output .= "<p class='pbx-text'>" . PB_REQ_SUBMITTED_MSG . "</p>"; $submitted_output .= "</div>"; } else { $submitted_output = "<div id='praybox_wrapper'>"; $submitted_output .= "<h2 class='pbx-title'>" . PB_REQ_FAIL_TITLE . "</h2>"; $submitted_output .= "<p class='pbx-text'>" . PB_REQ_FAIL_MSG . "</p><ul>"; if (isDuplicate($first_name, $last_name, $email, $title, $ip_address) == "fail") { $submitted_output .= "<li>" . PB_REQ_FAIL_DUPLICATE . "</li>"; } if ($_POST['required'] != "") { $submitted_output .= "<li>" . PB_REQ_FAIL_SPAM . "</li>"; } if (isIPBanned($ip_address) == "fail") { $submitted_output .= "<li>" . PB_REQ_FAIL_BANNED . "</li>"; } $submitted_output .= "</ul></div>"; } return $submitted_output; } else { if (!isset($_GET['pbid']) || $_GET['pbid'] == "") { $stat = 0; //new request $anon = ""; $notify = ""; $sub_form_title = PB_FORM_TITLE; $sub_form_msg = get_option('PB_REQ_form_intro'); $sub_form_action = "submit_request"; $sub_form_req_id_input = ""; $sub_form_submit = PB_FORM_SUBMIT; } else { $authcode = $_GET['pbid']; if (isRequestActive($authcode) == "yes") { $prayer_request = $wpdb->get_row("SELECT id,first_name,last_name,anon,email,title,body,notify FROM " . $wpdb->prefix . "pb_requests WHERE authcode='{$authcode}'"); $stat = 1; //open request $anon = $prayer_request->anon == 1 ? "checked" : ""; $notify = $prayer_request->notify == 1 ? "checked" : ""; $sub_form_title = PB_FORM_EDIT_TITLE; $sub_form_msg = PB_FORM_EDIT_MSG; $sub_form_action = "update_request"; $sub_form_req_id_input = "<input type='hidden' name='req_id' value='" . $prayer_request->id . "' />"; $sub_form_submit = PB_FORM_EDIT_SUBMIT; } else { $stat = 2; //request is closed } } $sub_form_output = "<div id='praybox_wrapper'>"; if ($stat == 2) { //CLOSED REQUEST OUTPUT $sub_form_output .= "<h2 class='pbx-title'>" . PB_FORM_CLOSED_TITLE . "</h2>"; $sub_form_output .= "<p class='pbx-text'>" . PB_FORM_CLOSED_MSG . "</p>"; } else { //INITIAL SUBMISSION FORM OUTPUT $sub_form_output .= "<h2 class='pbx-title'>{$sub_form_title}</h2>"; $sub_form_output .= "<p class='pbx-text'>{$sub_form_msg}</p>"; $sub_form_output .= "<form class='pbx-form' method='post'><input type='hidden' name='action' value='{$sub_form_action}' />{$sub_form_req_id_input}"; $sub_form_output .= $stat == 0 ? "<div class='pbx-formfield'><label>" . PB_FORM_FIRST_NAME . ":</label><input type='text' name='first_name' /></div>" : ""; $sub_form_output .= $stat == 0 ? "<div class='pbx-formfield'><label>" . PB_FORM_LAST_NAME . ":</label><input type='text' name='last_name' /></div>" : ""; $sub_form_output .= "<div class='pbx-formfield'><label><input type='checkbox' name='anon' {$anon} /> " . PB_FORM_ANONYMOUS . "</label></div>"; $sub_form_output .= $stat == 0 ? "<div class='pbx-formfield'><label>" . PB_FORM_EMAIL . ":</label><input type='text' name='email' /></div>" : ""; $sub_form_output .= $stat == 0 ? "<div class='pbx-formfield'><label>" . PB_FORM_REQTITLE . ":</label><input type='text' name='title' /></div>" : ""; $sub_form_output .= $stat == 0 ? "<div class='pbx-formfield'><label>" . PB_FORM_REQ . ":</label><textarea name='body'></textarea></div>" : ""; $sub_form_output .= "<div class='pbx-formfield'><label><input type='checkbox' name='notify' {$notify} /> " . PB_FORM_NOTIFY . "</label></div>"; $sub_form_output .= $stat == 1 ? "<div class='pbx-formfield'><label><input type='checkbox' name='closed' /> " . PB_FORM_EDIT_CLOSE . "</label></div>" : ""; $sub_form_output .= "<div class='pbx-formfield'><input type='submit' value='{$sub_form_submit}' /></div>"; $sub_form_output .= "</form>"; } $sub_form_output .= "</div>"; return $sub_form_output; /* }else{ $authcode=$_GET['pbid']; if (isRequestActive($authcode)=="yes"){ //IF REQUEST IS OPEN $prayer_request=$wpdb->get_row("SELECT id,first_name,last_name,anon,email,title,body,notify FROM ".$wpdb->prefix."pb_requests WHERE authcode='$authcode'"); $req_id=$prayer_request->id; if($prayer_request->anon==1){$anon="checked";}else{$anon="";} if($prayer_request->notify==1){$notify="checked";}else{$notify="";} $mgmt_form_output="<div id='praybox'>"; $mgmt_form_output.="<div class='title'>Make Changes to Your Prayer Request<div style='clear:both;'></div></div>"; $mgmt_form_output.="<div class='intro'>Use the form below to make changes to your prayer request listing.<div style='clear:both;'></div></div>"; $mgmt_form_output.="<form method='post'><input type='hidden' name='action' value='update_request' /><input type='hidden' name='req_id' value='$req_id' />"; $mgmt_form_output.="<table class='subform'>"; $mgmt_form_output.="<tr><td class='checkbox'><input type='checkbox' name='anon' $anon /> I would like to remain anonymous. Please do not post my name.</td></tr>"; $mgmt_form_output.="<tr><td class='checkbox'><input type='checkbox' name='notify' $notify /> I would like to be notified (once per day) when I have been prayed for.</td></tr>"; $mgmt_form_output.="<tr><td><hr /></td></tr>"; $mgmt_form_output.="<tr><td class='checkbox'><input type='checkbox' name='closed' /> I would like to close this prayer request.</td></tr>"; $mgmt_form_output.="<tr><td class='submit'><input type='submit' value='Update My Prayer Request' /></td></tr>"; $mgmt_form_output.="</table>"; $mgmt_form_output.="</form>"; $mgmt_form_output.="<div style='clear:both;'></div></div>"; }else{ //IF REQUEST IS CLOSED $mgmt_form_output="<div id='praybox'>"; $mgmt_form_output.="<div class='title'>This Request Has Been Closed<div style='clear:both;'></div></div>"; $mgmt_form_output.="<div class='intro'>Sorry, this Prayer Request has been closed and can no longer be edited.<div style='clear:both;'></div></div>"; $mgmt_form_output.="<div style='clear:both;'></div></div>"; } return $mgmt_form_output; } */ } }