Exemplo n.º 1
0
<div class="container">
<?php 
if ($show_user_win) {
    ?>
<div class="win-message">
	<div id="exit-win-message">X</div>
	<script>
		$("#exit-win-message").click(function(){
			$(".win-message").fadeOut();
		});
	</script>
	<?php 
    $win_user = new User();
    $win_user->loadByGUID($_SESSION['guid']);
    if ($win_user->guid == $product->getWinner()->guid) {
        svMail($win_user->email, 'Gefeliciteerd! U hebt gewonnen!', array('url' => $product->getURL(), 'name' => $win_user->username, 'product_name' => $product->name, 'mailadress' => $product->user->email), 'on_win');
        //winner
        ?>
		<h1>Je hebt gewonnen!</h1>
		<p>
			Neem contact op met de eigenaar van dit product op het volgende emailadres: <a href="mailto:<?php 
        echo $product->user->email;
        ?>
"><?php 
        echo $product->user->email;
        ?>
</a><br />
			<br />
			U bent zelf verantwoordelijk voor het eventuele verzenden of ophalen van dit product.
		</p>
		<?php 
 public function syncToDatabase()
 {
     $url = getGUID(40);
     $sql = insert_sql("INSERT INTO ra_mail(user_guid, url, action) VALUES(?,?,?)", 'ssi', array($this->guid, $url, ACTIONRESETPASSWORD));
     if ($sql) {
         svMail($this->data['email'], "Registratie spullenverloten.nl", array(MAILUSERNAME => $this->username, MAILCODE => $url), 'reset');
         $this->message = "Er zijn instructies verstuurd naar uw emailadres.";
         $this->state = STATE_SUCCESS;
     } else {
         $this->message = "Er ging onverwacht iets mis. Probeer het later nog eens.";
     }
 }
Exemplo n.º 3
0
 public function doDraw()
 {
     if (strtotime($this->allot_date) < strtotime("now") && !$this->isgone) {
         $users = $this->getUsers();
         if (count($users) > 0) {
             $amount_of_users = count($users);
             $amount_of_users--;
             $winner_number = round(rand(0, $amount_of_users));
             $winner = $users[$winner_number];
             $insert = insert_sql("UPDATE product SET winner_guid = ?, isgone = 1 WHERE guid = ?", 'ss', array($winner->guid, $this->guid));
             if ($insert) {
                 foreach ($users as $user) {
                     svMail($user->email, $this->name . " is zojuist verloot!", array('product_name' => $this->name, 'product_url' => 'http://' . BASEURL . $this->getURL() . '/c'), 'on_allot');
                 }
                 return true;
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }