function countStats()
{
    $resultData = array();
    $today = date('Y-m-d');
    $loadData = Post::get(array('query' => "select count(postid)as totalcount from " . Database::getPrefix() . "post"));
    $resultData['post']['total'] = $loadData[0]['totalcount'];
    $loadData = Post::get(array('query' => "select count(postid)as totalcount from " . Database::getPrefix() . "post where DATE(date_added)='{$today}'"));
    $resultData['post']['today'] = $loadData[0]['totalcount'];
    $loadData = Post::get(array('query' => "select count(postid)as totalcount from " . Database::getPrefix() . "post where status='1'"));
    $resultData['post']['published'] = $loadData[0]['totalcount'];
    $loadData = Post::get(array('query' => "select count(postid)as totalcount from " . Database::getPrefix() . "post where status='0'"));
    $resultData['post']['pending'] = $loadData[0]['totalcount'];
    $loadData = Comments::get(array('query' => "select count(commentid)as totalcount from " . Database::getPrefix() . "comments"));
    $resultData['comments']['total'] = $loadData[0]['totalcount'];
    $loadData = Comments::get(array('query' => "select count(commentid)as totalcount from " . Database::getPrefix() . "comments where DATE(date_added)='{$today}'"));
    $resultData['comments']['today'] = $loadData[0]['totalcount'];
    $loadData = Comments::get(array('query' => "select count(commentid)as totalcount from " . Database::getPrefix() . "comments where status='1'"));
    $resultData['comments']['approved'] = $loadData[0]['totalcount'];
    $loadData = Comments::get(array('query' => "select count(commentid)as totalcount from " . Database::getPrefix() . "comments where status='0'"));
    $resultData['comments']['pending'] = $loadData[0]['totalcount'];
    $loadData = Contactus::get(array('query' => "select count(contactid)as totalcount from " . Database::getPrefix() . "contactus"));
    $resultData['contactus']['total'] = $loadData[0]['totalcount'];
    $loadData = Contactus::get(array('query' => "select count(contactid)as totalcount from " . Database::getPrefix() . "contactus where DATE(date_added)='{$today}'"));
    $resultData['contactus']['today'] = $loadData[0]['totalcount'];
    $loadData = Users::get(array('query' => "select count(userid)as totalcount from " . Database::getPrefix() . "users"));
    $resultData['users']['total'] = $loadData[0]['totalcount'];
    $loadData = Users::get(array('query' => "select count(userid)as totalcount from " . Database::getPrefix() . "users where DATE(date_added)='{$today}'"));
    $resultData['users']['today'] = $loadData[0]['totalcount'];
    return $resultData;
}
function contactProcess()
{
    if (Session::has('contactus')) {
        $total = (int) Session::get('contactus');
        if ($total >= 5) {
            Redirect::to('404page');
            // Alert::make('Page not found');
        }
    }
    $valid = Validator::make(array('send.fullname' => 'min:2|slashes', 'send.email' => 'min:5|slashes', 'send.content' => 'min:3|slashes'));
    if (!$valid) {
        $alert = '<div class="alert alert-warning">Contact information not valid.</div>';
        return $alert;
    }
    if (!($id = Contactus::insert(Request::get('send')))) {
        $alert = '<div class="alert alert-warning">Error. ' . Database::$error . '</div>';
        return $alert;
    }
    if (Session::has('contactus')) {
        $total = (int) Session::get('contactus');
        $total++;
        Session::make('contactus', $total);
    } else {
        Session::make('contactus', '1');
    }
    $alert = '<div class="alert alert-success">Success. We will response soon!</div>';
    return $alert;
}
 public function view()
 {
     if (!($match = Uri::match('\\/view\\/(\\d+)'))) {
         Redirect::to(ADMINCP_URL . 'contacts/');
     }
     $postid = $match[1];
     $post = array('alert' => '');
     $loadData = Contactus::get(array('where' => "where contactid='{$postid}'"));
     $post = $loadData[0];
     System::setTitle('View contact - ' . ADMINCP_TITLE);
     View::make('admincp/head');
     self::makeContents('contactView', $post);
     View::make('admincp/footer');
 }
Example #4
0
function actionProcess()
{
    $id = Request::get('id');
    if (!isset($id[0])) {
        return false;
    }
    $listID = "'" . implode("','", $id) . "'";
    $action = Request::get('action');
    // die($action);
    switch ($action) {
        case 'delete':
            Contactus::remove($id);
            break;
    }
}
Example #5
0
<?php

use Project\Classes\DB\DB;
include '../../autoloader.php';
//require_once '../Model/Contactus.php';
require_once '../../contact_us_page/Model/Contactus.php';
$contact_id = $_POST["id"];
$first_name = htmlspecialchars($_POST["firstname"]);
$last_name = htmlspecialchars($_POST["lastname"]);
$Email = htmlspecialchars($_POST["email"]);
$Message = htmlspecialchars($_POST["message"]);
$modifiedContact = new Contactus();
$modifiedContact->updateFrom($contact_id);
?>

<!Doctype HTML>
<html>
<head>
   <meta charset="utf-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <link rel="stylesheet" href="/Assets/css/bootstrap.min.css"/>
   <link rel="stylesheet" href="/Assets/css/style.css"/>

   <title>List of contacts</title>
</head>
<boby>

<div class="container">
<h1> You have made the following changes :</h1>
Example #6
0
<?php

use Project\Classes\DB\DB;
include '../../autoloader.php';
//require_once '../Model/Contactus.php';
require_once '../../contact_us_page/Model/Contactus.php';
$sel_record = $_POST['sel_record'];
$editValues = new Contactus();
$editResult = $editValues->editForm($sel_record);
?>
<!Doctype HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/Assets/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/Assets/css/style.css"/>

    <title> Modified contacts</title>
</head>
    <boby>
        <div class="container">
                <form method ="post" action ="/admin/editedContact">
                    <fieldset class="form-group">
                    <input type ="hidden" name = "id" value=" <?php 
echo $sel_record;
?>
 "/>
                    </fieldset>
                    <fieldset class="form-group">
Example #7
0
<body style="background-color:#CEF6D8;">
<?php 
use Project\Classes\DB\DB;
include '../../autoloader.php';
require_once '../Model/Contactus.php';
$contact_id = $_POST['confirmid'];
$deletedRecord = new Contactus();
$result = $deletedRecord->confirmDelete($contact_id);
$contact_id = $result['contact_id'];
$first_name = $result['first_name'];
$last_name = $result['last_name'];
$Email = $result['Email'];
$Message = $result['Message'];
//show confirmation  that record has been deleted
echo "<div class=\"container\">";
echo "<h3>" . $first_name . " <br/>  " . $last_name . " </br>  " . $Email . " </br>  " . $Message . " <br/>" . "<h2 style ='color:green;'>" . "   Has been permanently deleted.!!! " . "</h2>" . "</h3>";
echo "</div>";
$deletedRecord->deletedContactDB($contact_id);
?>
<!Doctype HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/Assets/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/Assets/css/style.css"/>

    <title>List of contacts</title>
</head>
Example #8
0
 public function actionContactus()
 {
     $this->allowjs = "allowminjs";
     $model = new Contactus('captchaRequired');
     if (isset($_POST['Contactus'])) {
         $model->attributes = $_POST['Contactus'];
         if ($model->save(false)) {
             //send a mail to Coach .repalce the static mail id using $to
             $to = 'coach email address';
             $subject = 'Request from Contact Us';
             //Need to add from email address
             $headers = "From: " . $model->contact_email . "\r\n";
             //$headers .= "CC: info@wincito.com\r\n";
             $headers .= "MIME-Version: 1.0\r\n";
             $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
             $message = '<html><body>';
             $message .= '<br><br>Hai Admin,<br><br>';
             $message .= 'This is ' . $model->contact_name . '<br> This is the Help I need :<br><i>' . $model->contact_help . '</i><br><br>';
             $message .= 'Thanks ,<br>' . $model->contact_name . '<br>' . $model->contact_email;
             /*$message .= ;
               
               
               
               $message .= ;
               
               
               
               $message .= ;
               
               
               
               $message .= */
             $message .= "</body></html>";
             if (mail('*****@*****.**', $subject, $message, $headers)) {
                 Yii::app()->user->setFlash('contactus', 'Thanks for contacting us!!We will get back to you soon.');
             }
             $this->refresh();
         } else {
             /* Yii::app()->user->setFlash('contactus','Please fill in all details!!.');*/
             /* $this->redirect(array('create'));*/
         }
     }
     $this->render('contactus', array('model' => $model));
 }
 public function updateContactUs()
 {
     $userId = $this->request->input('userId');
     $UserExist = User::where('id', $userId)->pluck('id');
     if ($UserExist) {
         $UserData = Input::all();
         $UserData['complaint_by'] = Auth::user()->id;
         Contactus::create($UserData);
         return 'success';
     } else {
         return 'session_expired';
     }
 }
Example #10
0
              </li>
              

              
            </ul>


            <!-- Top Menu Items -->
            <ul class="nav navbar-right top-nav">

                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-envelope"></i> <b class="caret"></b></a>
                    <ul class="dropdown-menu message-dropdown">
                        <?php 
$today = date('Y-m-d');
$loadData = Contactus::get(array('limitShow' => 5, 'cacheTime' => 30, 'where' => "where DATE(date_added)='{$today}'", 'orderby' => 'order by contactid desc'));
if (isset($loadData[0]['contactid'])) {
    $li = '';
    $total = count($loadData);
    for ($i = 0; $i < $total; $i++) {
        $li .= '
                            <li class="message-preview">
                                <a href="' . $loadData[$i]['url'] . '">
                                    <div class="media">
                                        
                                        <div class="media-body">
                                            <h5 class="media-heading"><strong>' . $loadData[$i]['fullname'] . '</strong>
                                            </h5>
                                            <p class="small text-muted"><i class="fa fa-clock-o"></i> ' . $loadData[$i]['date_addedFormat'] . '</p>
                                            <p>' . substr($loadData[$i]['content'], 0, 50) . '...</p>
                                        </div>
Example #11
0
<?php

use Project\Classes\DB\DB;
include '../../autoloader.php';
require_once '../../contact_us_page/Model/Contactus.php';
//require_once '../Model/Contactus.php'; // UNCOMMENT THIS LINE IF YOU ARE RUNNING THIS PAGE FROM DIRECTLY AND COMMENT ABOVE LINE
$contactList = new Contactus();
$selectResult = $contactList->displayContacts();
?>
<!Doctype HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/Assets/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/Assets/css/style.css"/>

    <title>List of contacts</title>
</head>

<!--<?php 
//include '../../Assets/html/header.php'
?>
-->
<!--<div class="container">-->
<body>
<h2>List of contacts</h2>

<table class="table table-bordered">
    <thead style="color:rosybrown;font-size: 24px;">
Example #12
0
<body style="background-color:#CEF6D8;">
<?php 
use Project\Classes\DB\DB;
include '../../autoloader.php';
require_once '../Model/Contactus.php';
$sel_record = $_POST['sel_record'];
$deleteContactList = new Contactus();
$result = $deleteContactList->deleteMovie($sel_record);
$contact_id = $result['contact_id'];
$first_name = $result['first_name'];
$last_name = $result['last_name'];
$Email = $result['Email'];
$Message = $result['Message'];
?>

<!Doctype HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/Assets/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/Assets/css/style.css"/>

    <title>Delete contacts</title>
</head>
<body>

<div class="container">
<h2>Are you sure you want to delete this record !! ? </h2>
Example #13
0
    $last_name = htmlspecialchars($_POST['last_name']);
    $Email = htmlspecialchars($_POST['Email']);
    $Message = htmlspecialchars($_POST['Message']);
    $Message = trim($Message);
    //===validate the input=========
    $validate = new Contactus();
    $error = $validate->validFname($first_name);
    $error .= $validate->validLastname($last_name);
    $error .= $validate->validEmail($Email);
    $error .= $validate->validMessagebox($Message);
    // ====Validation End here=====
    //After submitting form redirect user to main page
    if (empty($error)) {
        $success = "Your message has been submitted successfully.";
        //header("Location:contact.php?msg=success");
        $storeUservalue = new Contactus();
        $storeUservalue->contactProcess();
        // Call the GMail file to sent an Email
        include '../../controller/sentToGmail.php';
    }
}
?>
<!Doctype HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/Assets/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/Assets/css/style.css"/>
    <link rel="stylesheet" href="/Assets/css/contactUS.css">