예제 #1
0
            break;
    }
    $email = '<!DOCTYPE html ><html><body><meta http-equiv="Content-Type" content="text/html;charset=utf-8"/><center><table id="wrapper" width="600" cellspacing="0" cellpadding="0" border="0" ><tr><td style="padding:0px;border-collapse:collapse;font-family:Arial, Helvetica, sans-serif;text-align: center"><img style="border:0;height:auto;line-height:100%;outline:none;text-decoration:none;float:left;" width="600" height="67" src="http://comunidad.nitragin.com.ar/mailing/notif/img/header.png"/></a></td></tr><tr><td style="border-collapse:collapse;padding-right:31px;font-family:Helvetica, sans-serif;padding-top:25px;"><table style="margin:0;"><tr><td style="padding:0;padding-left:150px;border-collapse:collapse;font-family:Arial, Helvetica, sans-serif;text-align: center;padding-top:20px;" ><img width="44" height="44" src="http://comunidad.nitragin.com.ar/mailing/notif/img/msg.png"/ style="float:right;border:0;height:auto;line-height:100%;outline:none;text-decoration:none;"><br></td><td style="padding:0;border-collapse:collapse;font-family:Arial, Helvetica, sans-serif;text-align: center;padding-top:10px;"><p style="font-family:Helvetica, sans-serif;float:left;font-size:15px;color:#66686A;margin:0;mso-line-height-rule:exactly;line-height:13px;text-align: left;">Has recibido un nuevo mensaje de<br>' . $from . '</p></td></tr></table></td></tr><tr><td style="border-collapse:collapse;font-family:Helvetica, sans-serif;text-align:center;padding-bottom:40px;"><table style="margin:0;"><tr><td style="padding:0;border-collapse:collapse;font-family:Arial, Helvetica, sans-serif;text-align: center;padding-left:240px;" ><a href="' . $link . '"><img src="http://comunidad.nitragin.com.ar/mailing/notif/img/more.png" width="53" height="20"></a></td></tr></table></td></tr><tr><td style="border-collapse:collapse;font-family:Helvetica, sans-serif;text-align:center;background-color:#3F2B3C"><table style="margin:0;"><tr><td style="padding:7px 0px;padding-left:20px;border-collapse:collapse;font-family:Arial, Helvetica, sans-serif;text-align: left;" ><img width="139" height="20" src="http://comunidad.nitragin.com.ar/mailing/notif/img/commL.png"/ style="float:right;border:0;height:auto;line-height:100%;outline:none;text-decoration:none;"><br></td></tr></table></td></tr></table></center><style type="text/css">table{font-family:Arial, Helvetica, sans-serif;border:0;}p{text-align:justify;}</style><style type="text/css">/* Client-specific Styles */#outlook a{padding:0;}/* Force Outlook to provide a "view in browser" button. */body{width:100% !important;}.ReadMsgBody{width:100%;}.ExternalClass{width:100%;}/* Force Hotmail to display emails at full width */body{-webkit-text-size-adjust:none;}/* Prevent Webkit platforms from changing default text sizes. *//* Reset Styles */body{margin:0px auto;padding:0;font-family:Arial, Helvetica, sans-serif;}img{border:0;height:auto;line-height:100%;outline:none;text-decoration:none;float:left;}</style></body></html>';
    $subject = "Nueva notificacion en Nitragin Comunidad";
    $fromM = "*****@*****.**";
    $headers = "From:" . $fromM . "\r\n";
    $headers .= "Reply-To:soporte@nitragin.com.ar\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
    mail($to['user'], $subject, $email, $headers);
}
$username = "******";
$password = "******";
$hostname = "localhost";
$db = "comm";
$title = $_POST['tit'];
$desc = $_POST['text'];
if ($_POST['tit'] != "" && $_POST['text'] != "") {
    $db = new mysqli($hostname, $username, $password, $db);
    $db->set_charset("utf8");
    mb_internal_encoding('UTF-8');
    if ($db->connect_errno > 0) {
        die('Unable to connect to database [' . $db->connect_error . ']');
    }
    if ($db->query("INSERT INTO tblnews (header,text,fromId,toId) VALUES ('" . $title . "','" . $desc . "','" . $_SESSION['userId'] . "','," . implode(",", $_POST['msgSel']) . ",')")) {
        echo 1;
        $id = $db->insert_id;
        sendMsgNotif($_SESSION['userId'], $_POST['msgSel'], $id, $title);
        addCategories($_POST['msgCatSel'], $id);
    }
}
예제 #2
0
$hostname = "localhost";
$db = "comm";
$id = $_POST['postId'];
if ($_POST['postId'] != "") {
    $db = new mysqli($hostname, $username, $password, $db);
    $db->set_charset("utf8");
    mb_internal_encoding('UTF-8');
    if ($db->connect_errno > 0) {
        die('Unable to connect to database [' . $db->connect_error . ']');
    }
    if ($row = $db->query("SELECT * FROM tblimgs WHERE imgId=" . $id . "")->fetch_array()) {
        $query = "INSERT INTO tblimgs (path,head,text,fromId,toId,total,shareable) VALUES ('" . $row['path'] . "','" . $row['head'] . "','" . $row['text'] . "'," . $_SESSION['userId'] . ",'," . implode(",", $_POST['shareSel']) . ",','" . $row['total'] . "',1)";
        if ($db->query("INSERT INTO tblimgs (path,head,text,fromId,toId,total,shareable,shared,sharedFrom) VALUES ('" . $row['path'] . "','" . $row['head'] . "','" . $row['text'] . "'," . $_SESSION['userId'] . ",'," . implode(",", $_POST['shareSel']) . ",','" . $row['total'] . "',1,1," . $id . ")")) {
            $id = $db->insert_id;
            $genPath = "uploads/imgs/" . $id;
            mkdir($genPath, 0777);
            $path = "uploads/imgs/" . $id . "/crop_S.jpg";
            $oldPath = "uploads/imgs/" . $_POST['postId'] . "/crop_S.jpg";
            if (copy($oldPath, $path)) {
                $ok = 1;
            } else {
                $ok = 0;
            }
            echo $ok;
            sendMsgNotif($_SESSION['userId'], $_POST['shareSel'], $id);
            addCategories($_POST['postId'], $id);
        } else {
            echo $query;
        }
    }
}