function cron_email()
 {
     $wpw_options = get_option('wpw_options');
     if ($wpw_options['cron_email'] == 1) {
         $last_email = $wpw_options['cron_last_email_date'];
         $emails = getAllAdmins();
         $sql = "SELECT post_title, guid FROM " . $wpdb->prefix . "posts WHERE post_modifiyed > " . $last_email;
         $subject = "Wiki Change";
         $results = $wpdb->get_results($sql);
         $message = " The following Wiki Pages has been modified on '" . get_option('home') . "' \n\r ";
         if ($results) {
             foreach ($results as $result) {
                 $pageTitle = $result->post_title;
                 $pagelink = $result->guid;
                 $message .= "Page title is " . $pageTitle . ". \n\r To visit this page <a href='" . $pagelink . "'> click here</a>.\n\r\n\r";
                 //exit(print_r($emails, true));
                 foreach ($emails as $email) {
                     wp_mail($email, $subject, $message);
                 }
             }
         }
         $wpw_options['cron_last_email_date'] = date('Y-m-d G:i:s');
         update_option('wpw_options', serialize($wpw_options));
     }
 }
Example #2
0
         $responce['result'] = 'FALSE';
     }
     echo json_encode($responce);
     break;
 case 'apply-for-fund':
     require_once DIR_APP . 'users.php';
     require_once DIR_APP . 'projects.php';
     $project_id = $_POST['project_id'];
     $user_id = $_SESSION['uid'];
     $investor_id = $_POST['investor_id'];
     applyProject($project_id, $investor_id);
     //updateFundStatusProject($project_id);
     $project_title = getProjectTitle($project_id);
     //$author = getUserNameById($_SESSION['uid']);
     $url = SITE_URL . '/home.php?pid=' . $project_id;
     $admins = getAllAdmins();
     foreach ($admins as $admin) {
         //
         $sento = $admin['user_id'];
         $user = getUserNameById($_SESSION['uid']);
         $texts = $user . ' Applied Project for funding "' . $project_title . '" thank you!';
         addNotification($sento, $texts, $_SESSION['uid'], $url);
     }
     $sent_to = getProjectAuthor($project_id);
     $text = 'Your Project  "' . $project_title . '" has been Applied for funding.We Will notify you back when project is reviewed.';
     addNotification($sent_to, $text, $_SESSION['uid'], $url);
     $responce['result'] = 'OK';
     echo json_encode($responce);
     break;
 case 'accept-project':
     require_once DIR_APP . 'users.php';
Example #3
0
            echo insert_user_form();
            break;
        case "newHotel":
            echo insert_hotel_form();
            break;
        case "showBookings":
            echo show_bookings_least();
            break;
        case "showtopBookings":
            echo show_bookings_top();
            break;
        case "showUsers":
            echo getNonAdmins();
            break;
        case "showAdmins":
            echo getAllAdmins();
            break;
    }
}
?>


                
            </div>

            <!--
                        <div class="tables">  
                            <h3>for hotels</h3>
<?php 
//echo hotel_login();
?>