<?php require 'functions.php'; session_start(); $uid = $_SESSION['uid']; checkValidUser($uid); $conn = connect($config); if ($conn) { $user_info = query("SELECT bio,dob,email,phone_number,address,zip FROM user_info WHERE uid = :uid", array('uid' => $uid), $conn)[0]; // dpr($user_info); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { $bio = $_POST['bio']; $dob = $_POST['dob']; $email = $_POST['email']; $phone_number = $_POST['phone_number']; $address = $_POST['address']; $zip = $_POST['zip']; if ($conn) { try { $insert_info = UPDATE("UPDATE user_info SET dob = :dob,email = :email,phone_number = :phone_number,address = :address,zip = :zip,bio = :bio WHERE uid=:uid", array('uid' => $uid, 'bio' => $bio, 'dob' => $dob, 'email' => $email, 'phone_number' => $phone_number, 'address' => $address, 'zip' => $zip), $conn)[0]; header("Location: swap.php"); } catch (Exception $e) { echo "<script>alert('Invalid zip code. Service does not exist');</script>"; } } } require 'editProfileT.php';
/* * if viewer country match video target country * will count it otherwise leave it */ $log .= "<b>Country target</b>: {$adCountry}<br/>"; if ($adCountry == $countryName || $adCountry == "any") { $log .= "Country: OK<br/>"; /* UPDATE [publink] number of views */ if ($row = SELECT(" * FROM publink_info WHERE pubUID=" . $id . " AND YTID LIKE '" . $link . "'")) { $log .= "YTID + publishID : FOUND<br/>"; UPDATE(" publink_info SET totalView=totalView+1 WHERE pubUID=" . $id . " AND YTID LIKE '" . $link . "'"); /* UPDATE [adlink] number of views*/ UPDATE(" adlink_info SET viewed=viewed+1 WHERE adUID=" . $adUID); /* If the country for this adLink exist just update number of views */ if ($row = SELECT(" * FROM publink_stat WHERE adUID=" . $adUID . " AND countryName LIKE '" . $countryName . "'")) { UPDATE(" publink_stat SET views=views+1 WHERE adUID=" . $adUID . " AND countryName LIKE '" . $countryName . "'"); } else { /* If the country for this adLink does not exist add a row and set it to 1 (number of views */ INSERT(" INTO publink_stat VALUES('" . $adUID . "','" . $countryCode . "','" . $countryName . "',1)"); } $log .= "<b>--- UPDATE DONE ---</b><br/>"; } else { $log .= "YTID({$link}) + publishID({$id}) : NOT Found on DB<br/>"; } } else { $log .= "Country: Missmatch<br/>"; } } } else { //Has been viewd during last GapView $timeago = $Now - $_SESSION['video'][$link];