Exemplo n.º 1
0
function usermessage_admin_show_form($SOURCE)
{
    // echo "<br />DEBUG2058: <pre>".print_r($SOURCE,1)."</pre>";
    //event 	subject 	message 	criteria 	reward 	once om detta meddelandet ska skickas bara en gång och inte varje gång något är uppfyllt	activated
    if (is_array($SOURCE['sendby'])) {
        $sendby = $SOURCE['sendby'];
    } else {
        $sendby = explode(",", $SOURCE['sendby']);
    }
    ?>
	<h2><?php 
    echo _("New message");
    ?>
</h2>
	<form method="post">
		<div class="form-group">
			<label for="event_text"><?php 
    echo _("Event:");
    ?>
</label>
			<input id="event_text" class="form-control" type="text" value="<?php 
    if (isset($SOURCE['event'])) {
        echo $SOURCE['event'];
    }
    ?>
" name="event">
		</div>
		<div class="form-group">
			<label for="subject_text"><?php 
    echo _("Subject:");
    ?>
</label>
			<input id="subject_text" class="form-control" type="text" value="<?php 
    if (isset($SOURCE['subject'])) {
        echo $SOURCE['subject'];
    }
    ?>
" name="subject">
		</div>
		<div class="form-group">
			<label for="message"><?php 
    echo _("message:");
    ?>
</label>
			<textarea class="form-control" name="message"><?php 
    if (isset($SOURCE['message'])) {
        echo $SOURCE['message'];
    }
    ?>
</textarea>
		</div>
		<div class="form-group">
			<label for="reward"><?php 
    echo _("Reward (on site currency, if any):");
    ?>
</label>
			<input class="form-control" type="text" value="<?php 
    if (isset($SOURCE['reward'])) {
        echo $SOURCE['reward'];
    }
    ?>
" name="reward">
		</div>
		<label><?php 
    echo _("Once:");
    ?>
</label>
		<div class="radio">
			<label>
				<input type="radio" name="once" value="multiple" />
				<?php 
    echo _("Multiple");
    ?>
			</label>
		</div>
		<div class="radio">
			<label>
				<input type="radio" name="once" value="once" checked="checked" />
				<?php 
    echo _("Once");
    ?>
			</label>
		</div>
		<div class="radio">
			<label>
				<input type="radio" name="once" value="one_instance" />
				<?php 
    echo _("One at the time");
    ?>
			</label>
		</div>
		<label for="sendby"><?php 
    echo _("Send by:");
    ?>
</label>
		<div class="checkbox">
			<label>
				<input type="checkbox" name="sendby[]" value="insite_privmess" <?php 
    if (in_array("insite_privmess", $sendby)) {
        echo ' checked="checked"';
    }
    ?>
 /> <?php 
    echo _("Private message on site");
    ?>
			</label>
		</div>
		<div class="checkbox">
			<label>
				<input type="checkbox" name="sendby[]" value="insite_notice" <?php 
    if (in_array("insite_notice", $sendby)) {
        echo ' checked="checked"';
    }
    ?>
 /> <?php 
    echo _("Notice popup on site");
    ?>
			</label>
		</div>
		<div class="checkbox">
			<label>
				<input type="checkbox" name="sendby[]" value="email" <?php 
    if (in_array("email", $sendby)) {
        echo ' checked="checked"';
    }
    ?>
 /> <?php 
    echo _("E-mail");
    ?>
			</label>
		</div>
		<label for="type"><?php 
    echo _("Type:");
    ?>
</label>
		<select class="form-control" name="type">
			<option value="information"><?php 
    echo _("Information");
    ?>
</option>
			<option value="success"><?php 
    echo _("Success");
    ?>
</option>
			<option value="warning"><?php 
    echo _("Warning");
    ?>
</option>
			<option value="error"><?php 
    echo _("Error");
    ?>
</option>
		</select>
		<h3><?php 
    echo _("Criteria");
    ?>
</h3>
		
		<?php 
    $_REQUEST['criteria_name'] = $SOURCE['criteria_name'];
    usermessage_criteria_form();
    ?>
		
		<br /><input class="btn btn-success" type='submit' name='add_message' value='Save this message'>
	</form>
	<?php 
}
Exemplo n.º 2
0
<?php

require_once "op_includer.php";
$connection = db_connect(db_host, db_name, db_user, db_pass);
usermessage_criteria_form();
db_close($connection);