vishwamano

source of vishwamano.com
git clone git://git.ricketyspace.net/vishwamano.git
Log | Files | Refs

commit ac9ea6193e93b11e217bba29a9b59f0cbcb7b311
parent 4c7f024c6422b172ec995036b969d2c6a9055fe3
Author: rsiddharth <s@ricketyspace.net>
Date:   Wed, 31 Oct 2018 18:18:27 -0400

utils.php: Remove old functions.

Diffstat:
utils.php | 172-------------------------------------------------------------------------------
1 file changed, 0 insertions(+), 172 deletions(-)

diff --git a/utils.php b/utils.php @@ -43,174 +43,3 @@ function get_captions($file) { } return false; } - -function register($email, $other_email) { - $to = $email; - $other_to = $other_email; - $name = $_POST['name']; - $email_address = $_POST['email']; - $phone = $_POST['phone']; - $blurb = $_POST['blurb']; - $humantest = $_POST['humantest']; - $submit = $_POST['submit']; - - $humantest_answer= "101"; - - if((strcmp($humantest, $humantest_answer) == 0) and - (!empty($name) and !empty($email_address))) { - - if(strcmp($submit, "1") == 0) { - $course = "Level 1 - Basic"; - }else { - $course = "Level 2 - Advanced"; - } - $course .= " Photography Course."; - - $email_subject = "[VishaMano.com] A&S ". $course. " Registration from $name"; - - $email_body = "$name <$email_address> has registered for the A&S ". $course. "\n\n". - "About $name:\n\n $blurb"; - - if(!empty($phone)) { - $email_body .= "\n\n $name can be buzzed at $phone"; - } - - $headers = "From: no-reply@vishwamano.com\n"; - $headers .= "Reply-To: $email_address"; - - mail($to,$email_subject,$email_body,$headers); - mail($other_to,$email_subject,$email_body,$headers); - - $alert_msg = 'You have registered for <strong>' - . $course . '</strong> <strong>Vishwa Manoharan</strong> will get back to you -soon. Should you have a query, kindly call/WhatsApp <strong>+91-9176560151</strong>.'; - $alert = array( 'type' => 'success', - 'content' => $alert_msg); - - } - else { - - $alert_msg = '<strong> Registration error</strong>. Please try again.' - . ' If problem persists email <strong>Vishwa Manoharan' - . ' &lt;vishwa91photography@gmail.com&gt;</strong>.'; - $alert = array( 'type' => 'danger', - 'content' => $alert_msg); - } - return $alert; -} - - -function request_shoot($email, $other_email) { - $to = $email; - $other_to = $other_email; - $name = $_POST['name']; - $email_address = $_POST['email']; - $phone = $_POST['phone']; - $shoot_t = $_POST['stype']; - $humantest = $_POST['humantest']; - - $humantest_answer = "101"; - - if((strcmp($humantest, $humantest_answer)== 0) and - (!empty($name) and !empty($email_address))) { - - $email_subject = "[VishaMano.com] Shoot Request from $name"; - - $email_body = "$name <$email_address> has requested for a shoot. \n\n" - . "Type of shoot: $shoot_t"; - - if(!empty($phone)) { - $email_body .= "\n\n$name can be buzzed at $phone"; - } - - $headers = "From: no-reply@vishwamano.com\n"; - $headers .= "Reply-To: $email_address"; - - mail($to, $email_subject, $email_body, $headers); - mail($other_to, $email_subject, $email_body, $headers); - - return 'success'; - - }else { - return 'error'; - } -} - - -function send_message($email, $other_email) { - $to = $email; - $other_to = $other_email; - $name = $_POST['name']; - $email_address = $_POST['email']; - $message = $_POST['message']; - $humantest = $_POST['humantest']; - - $humantest_answer= "100"; - - if((strcmp($humantest, $humantest_answer)== 0) and - (!empty($email_address) and !empty($message))) { - - $email_subject = "[VishaMano.com] Message from $name"; - - $email_body = "$name <$email_address> has messaged you. \n\n". - "The Message:\n\n$message"; - //"\n\n$name 's email address is $email_address"; - - $headers = "From: no-reply@vishwamano.com\n"; - $headers .= "Reply-To: $email_address"; - - $sent = mail($to,$email_subject,$email_body,$headers); - $sent_other = mail($other_to,$email_subject,$email_body,$headers); - - if($sent == FALSE) { - $alert_msg = '<strong> Error: Message not sent</strong>. Please try again.' - . ' If problem persists email <strong>Vishwa Manoharan' - . ' &lt;vishwa91photography@gmail.com&gt;.</strong>'; - $alert = array( 'type' => 'danger', - 'content' => $alert_msg); - }else { - $alert_msg = 'Your message has been sent to <strong>Vishwa Manoharan</strong>.'; - $alert = array( 'type' => 'success', - 'content' => $alert_msg); - } - } - else { - - $alert_msg = '<strong> Error: Message not sent</strong>. Please try again.' - . ' If problem persists email <strong>Vishwa Manoharan' - . ' &lt;vishwa91photography@gmail.com&gt;.</strong>'; - $alert = array( 'type' => 'danger', - 'content' => $alert_msg); - } - return $alert; -} - -function get_gallery_layout($no_of_images) { - $layout_array = array(); - $sum = 0; - $min = ($no_of_images % 2 == 0 ? 2 : 1); - $layout = $min; - - while($sum != ($no_of_images - $min)) { - if($layout > 4) { - $layout = $min; - } - if(($layout + $sum) > ($no_of_images - $min)) { - $layout += $min; - continue; - } - array_push($layout_array, $layout); - $sum += $layout; - $layout += $min; - } - - shuffle($layout_array); - array_push($layout_array, $min); - - $layout_str = ''; - foreach($layout_array as $layout) { - $layout_str .= strval($layout); - } - - return $layout_str; -}- \ No newline at end of file