<?php require "PHPMailer/class.phpmailer.php"; require_once "includes/application-top.php"; $dbObj = new DB(); $dbObj->fun_db_connect(); if (count($_POST) > 0) { $arr = $_POST; $arr['add_date'] = date("Y-m-d H:i:s"); $lastID1 = $dbObj->insert_data(TABLE_COMMENT, $arr); /* mail for new comment*/ if ($_SESSION['session_admin_userid'] == '') { if ($lastID1) { $_SESSION['msg'] = '<span style=" color:green;font-size:13px;">Your comment is successfully posted. Will display after approval.</span>'; } $user_name = 'jwasser.com'; //site url $mail = new PHPMailer(); $mail->From = "*****@*****.**"; $mail->FromName = $user_name; $mail->AddReplyTo($_POST['email']); $mail->AddAddress("*****@*****.**"); $mail->Subject = "Comment Posted On Post"; $mail->IsHTML(true); $mail->Body = "<b><font style='font-size:14px;'>Below comment posted on post for approvel</font></b><br><br>\n\t\t <br>" . $arr['comment'] . "<br>"; $mail->send(); //if(!$mail->send()){echo "Not Send";die;}else{echo "Mail Send";die;} } $sqlSel_com1 = "SELECT * FROM " . TABLE_COMMENT . " where post_id=" . $arr['post_id']; $rsResult_com1 = $dbObj->fun_db_query($sqlSel_com1); $total_comment = $dbObj->fun_db_get_num_rows($rsResult_com1);
if (count($_POST) > 0) { $arr = $_POST; $arr['add_date'] = date("Y-m-d H:i:s"); $arr['password'] = md5($arr['password']); $arr['status'] = 1; if ($_FILES['images']['name'] != '') { $randnum = rand(); $str = str_replace(' ', '_', $_FILES['images']['name']); $Small_logo_ImgFName = "user/user_" . $str; $image = new SimpleImage(); $image->load($_FILES['images']['tmp_name']); $image->resize(400, 300); $image->save($Small_logo_ImgFName); $arr['images'] = "user/user_" . $str; } $existusername = $dbObj->fun_check_username_admin_existance1($arr['username']); $existemail = $dbObj->fun_check_email_admin_existance1($arr['email']); if ($existusername) { $_SESSION['msg'] = "Username already Exits"; redirectURL(SITE_ADMIN_URL . "create-profile.php"); } elseif ($existemail) { $_SESSION['msg'] = "Email already Exits"; redirectURL(SITE_ADMIN_URL . "create-profile.php"); } else { $lastID = $dbObj->insert_data(TABLE_USERS, $arr); if ($lastID) { $_SESSION['msg'] = "<span style=' color:green;font-size:13px;'>Profile Created</span>"; redirectURL(SITE_ADMIN_URL . "create-profile.php"); } } }
<?php require_once "includes/application-top.php"; $dbObj = new DB(); $dbObj->fun_db_connect(); ?> <?php $sql_like = "SELECT * FROM " . TABLE_LIKE . " where post_id=" . $_REQUEST['post_id'] . " and user_id=" . $_REQUEST['user_id']; $rsResult_like = $dbObj->fun_db_query($sql_like); $like = $dbObj->fun_db_get_num_rows($rsResult_like); if ($like == '') { $arr['post_id'] = $_REQUEST['post_id']; $arr['user_id'] = $_REQUEST['user_id']; $lastID = $dbObj->insert_data(TABLE_LIKE, $arr); $sql_like1 = "SELECT * FROM " . TABLE_LIKE . " where post_id=" . $_REQUEST['post_id']; $rsResult_like1 = $dbObj->fun_db_query($sql_like1); $like1 = $dbObj->fun_db_get_num_rows($rsResult_like1); $arr['total_like'] = $like1; $lastID = $dbObj->update_data(TABLE_POST, 'id', $arr, md5($_REQUEST['post_id'])); echo $like1; } else { $sql_like1 = "SELECT * FROM " . TABLE_LIKE . " where post_id=" . $_REQUEST['post_id']; $rsResult_like1 = $dbObj->fun_db_query($sql_like1); $like1 = $dbObj->fun_db_get_num_rows($rsResult_like1); echo $like1; } ?>
$image->resize(400, 300); $image->save($Small_logo_ImgFName); $arr['image'] = "post/post_" . $str; } if ($_FILES['image']['name'] != '') { $randnum = rand(); $str = "large" . rand() . str_replace(' ', '_', $_FILES['image']['name']); $Small_logo_ImgFName = "post/post_" . $str; $image = new SimpleImage(); $image->load($_FILES['image']['tmp_name']); $image->resize(800, 600); //$image->resize(400,300); $image->save($Small_logo_ImgFName); $arr['larg_image'] = "post/post_" . $str; } $lastID = $dbObj->insert_data(TABLE_POST, $arr); $adminInfo = $objAdmin->fun_getAdminUserInfo(0, $_SESSION['session_admin_username']); if ($lastID) { $user_name = 'jwasser.com'; //site url $mail = new PHPMailer(); $mail->From = "*****@*****.**"; $mail->FromName = $user_name; $mail->AddReplyTo($adminInfo['email']); $mail->AddAddress("*****@*****.**"); $mail->Subject = "New Post"; $mail->IsHTML(true); $mail->Body = "<b><font style='font-size:14px;'>New Post on jwasser.</font></b><br><br>\n\t\t\t\t\t\t\t\t<br> Posted By : " . $_SESSION['session_admin_username'] . "<br>"; $mail->send(); //if(!$mail->send()){echo "Not Send";die;}else{echo "Mail Send";} $_SESSION['msg'] = "<span style=' color:green;font-size:13px;'>Post Insert Successfully</span>";