private function render($data, $users)
 {
     View::renderTemplate("header", $data, 'MetroTemplate');
     echo "<h1>";
     echo "Hello " . $users->fname;
     echo "</h1>";
     Session::set('user_name', $users->user_name);
     $o = "";
     $o .= Form::open(array('action' => 'logout', 'method' => 'post'));
     $o .= Form::hidden(array('id' => 'username', 'name' => 'username', 'value' => Session::get('user_name')));
     $o .= Form::submit(array());
     $o .= Form::close();
     echo $o;
     View::renderTemplate("footer", $data, 'MetroTemplate');
 }
?>
</h3>
		</div>
		<div class='panel-body'>
			<p><?php 
echo $data['welcome_message'];
?>
</p>

<?php 
// Check to see if message form is disabled
if ($data['hide_form'] != "true") {
    ?>

			<?php 
    echo Form::open(array('method' => 'post'));
    ?>

      <!-- To UserName -->
      <div class='input-group' style='margin-bottom: 25px'>
        <span class='input-group-addon'><i class='glyphicon glyphicon-user'></i> </span>
        <?php 
    echo Form::input(array('type' => 'text', 'name' => 'to_username', 'class' => 'form-control', 'value' => $data['to_username'], 'placeholder' => 'To Username', 'maxlength' => '100'));
    ?>
      </div>

      <!-- Subject -->
      <div class='input-group' style='margin-bottom: 25px'>
        <span class='input-group-addon'><i class='glyphicon glyphicon-book'></i> </span>
        <?php 
    echo Form::input(array('type' => 'text', 'name' => 'subject', 'class' => 'form-control', 'value' => $data['subject'], 'placeholder' => 'Subject', 'maxlength' => '100'));
if (isset($data['message'])) {
    echo "<table class='table table-bordered table-striped responsive'>";
    foreach ($data['message'] as $row) {
        echo "<tr>";
        echo "<td>{$row->subject}</td>";
        echo "</tr><tr><td>";
        echo "<b>Date Sent:</b> " . date("F d, Y - g:i A", strtotime($row->date_sent)) . "<br>";
        // Check to see if message is marked as read yet
        if (isset($row->date_read)) {
            echo "<b>Date Read:</b> " . date("F d, Y - g:i A", strtotime($row->date_read)) . "<br>";
        }
        echo "<b>From:</b> <a href='" . DIR . "Profile/{$row->username}'>{$row->username}</a>";
        echo "</td></tr><tr>";
        echo "<td>{$row->content}</td>";
        echo "</tr><tr><td>";
        echo Form::open(array('method' => 'post', 'action' => DIR . 'NewMessage'));
        echo "<input type='hidden' name='csrf_token' value='{$data['csrf_token']}' />";
        echo "<input type='hidden' name='reply' value='true' />";
        echo "<input type='hidden' name='to_username' value='{$row->username}' />";
        echo "<input type='hidden' name='subject' value=\"{$row->subject}\" />";
        echo "<input type='hidden' name='content' value=\"{$row->content}\" />";
        echo "<input type='hidden' name='date_sent' value='" . date("F d, Y - g:i A", strtotime($row->date_sent)) . "' />";
        echo "<button class='btn btn-md btn-success' name='submit' type='submit'>";
        echo "Reply";
        echo "</button>";
        echo Form::close();
        echo "</td></tr>";
    }
    echo "</table>";
}
?>
Esempio n. 4
0
?>

      <?php 
if ($data['g_groupID'] == "4") {
    echo "<br><div class='alert alert-warning'><b>NOTE</b>: By default this group has full access to the website and can not be deleted. Default Group Name: <b>Administrator</b></div>";
} else {
    if ($data['g_groupID'] == "3") {
        echo "<br><div class='alert alert-warning'><b>NOTE</b>: By default this group has set access to the website and can not be deleted. Default Group Name: <b>Moderator</b></div>";
    } else {
        if ($data['g_groupID'] == "2") {
            echo "<br><div class='alert alert-warning'><b>NOTE</b>: By default this group has limited access to the website and can not be deleted. Default Group Name: <b>Member</b></div>";
        } else {
            if ($data['g_groupID'] == "1") {
                echo "<br><div class='alert alert-warning'><b>NOTE</b>: By default this group has limited access to the website and can not be deleted. Default Group Name: <b>New Member</b></div>";
            } else {
                echo "<br><br>";
                echo Form::open(array('method' => 'post', 'style' => 'display:inline-block'));
                echo "<input type='hidden' name='csrf_token' value='" . $data['csrf_token'] . "'>";
                echo "<input type='hidden' name='delete_group' value='true' />";
                echo "<input type='hidden' name='ag_groupID' value='" . $data['g_groupID'] . "'>";
                echo "<button class='btn btn-xs btn-danger' name='submit' type='submit'>Delete Group</button>";
                echo Form::close();
            }
        }
    }
}
?>
		</div>
	</div>
</div>
Esempio n. 5
0
	<div class='panel panel-default'>
		<div class='panel-heading'>
			<h3 class='jumbotron-heading'><?php 
echo $data['title'];
?>
</h3>
		</div>
		<div class='panel-body'>
				<?php 
echo $data['welcome_message'];
?>


            <?php 
echo Form::open(array('method' => 'post', 'enctype' => 'multipart/form-data'));
?>

            <!-- Topic Title -->
            <div class='input-group' style='margin-bottom: 25px'>
              <span class='input-group-addon'><i class='glyphicon glyphicon-book'></i> </span>
              <?php 
echo Form::input(array('type' => 'text', 'name' => 'forum_title', 'class' => 'form-control', 'value' => $data['forum_title'], 'placeholder' => 'Topic Title', 'maxlength' => '100'));
?>
            </div>

            <!-- Topic Content -->
            <div class='input-group' style='margin-bottom: 25px'>
              <span class='input-group-addon'><i class='glyphicon glyphicon-pencil'></i> </span>
              <?php 
echo Form::textBox(array('type' => 'text', 'name' => 'forum_content', 'class' => 'form-control', 'value' => $data['forum_content'], 'placeholder' => 'Topic Content', 'rows' => '6'));
Esempio n. 6
0
<div <div id="global_container">
    <h1 class="form_header">Log in</h1>
    <?php 
if ($error != null) {
    ?>
        <div id="login_error_wrapper">
            <?php 
    echo Error::display($error);
    ?>
        </div>
    <?php 
}
?>
    <div class="form_wrapper">
        <?php 
echo Form::open(array("method" => "post", "action" => "login"));
?>
            <div class="p">
                <?php 
echo Form::input(array("name" => "login_email", "placeholder" => "Email"));
?>
            </div>
            <div class="p">
                <?php 
echo Form::input(array("name" => "login_password", "placeholder" => "Password", "type" => "password"));
?>
            </div>
            <div class="p">
                <div id="checkbox_container">
                    <label id="checkbox_label" for="remember_checkbox">Remember me</label>
                    <?php 
             // Check to see if object is at bottom
             if ($data['fourm_cat_main_last'] != $row->forum_order_title) {
                 echo "<a href='" . DIR . "AdminPanel-Forum-Categories/CatMainDown/{$row->forum_order_title}' class='btn btn-primary btn-xs' role='button'><span class='glyphicon glyphicon-triangle-bottom' aria-hidden='true'></span></a> ";
             }
             echo "<a href='" . DIR . "AdminPanel-Forum-Categories/CatMainEdit/{$row->forum_id}' class='btn btn-success btn-xs' role='button'><span class='glyphicon glyphicon-cog' aria-hidden='true'></span> Edit</a> ";
             echo "<a href='" . DIR . "AdminPanel-Forum-Categories/CatSubList/{$row->forum_id}' class='btn btn-info btn-xs' role='button'><span class='glyphicon glyphicon-list' aria-hidden='true'></span> Sub Categories</a> ";
             echo "<a href='" . DIR . "AdminPanel-Forum-Categories/DeleteMainCat/{$row->forum_id}' class='btn btn-danger btn-xs' role='button'><span class='glyphicon glyphicon-remove-circle' aria-hidden='true'></span></a> ";
             echo "</div>";
             echo "</div>";
             echo "</div>";
         }
         // End of foreach
     }
     // End of isset
     // Display form to create new Main Category
     echo Form::open(array('method' => 'post', 'action' => DIR . 'AdminPanel-Forum-Categories/CatMainNew/1'));
     echo "<div class='panel panel-info'>";
     echo "<div class='panel-heading'>";
     echo "<i class='glyphicon glyphicon-list'></i> New Main Category Title";
     echo "</div>";
     echo "<div class='panel-body'>";
     echo Form::input(array('type' => 'hidden', 'name' => 'action', 'value' => 'new_cat_main_title'));
     echo Form::input(array('type' => 'hidden', 'name' => 'csrf_token', 'value' => $data['csrf_token']));
     echo Form::input(array('type' => 'text', 'name' => 'forum_title', 'class' => 'form-input text form-control', 'aria-describedby' => 'basic-addon1', 'placeholder' => 'New Main Category Title', 'maxlength' => '100'));
     echo "</div>";
     echo "<div class='panel-footer'>";
     echo "<button class='btn btn-success' name='submit' type='submit'>Create New Main Category Title</button>";
     echo "</div>";
     echo "</div>";
     echo Form::close();
 }
Esempio n. 8
0
<?php

use Helpers\Form;
use Helpers\Session;
use Core\Error;
$rainCaptcha = new \Helpers\RainCaptcha();
?>

<div <div id="global_container">
    <h1 class="form_header">Register</h1>
    <div class="form_wrapper">
        <?php 
echo Form::open(array("method" => "post"));
?>
            <div class="p">
                <?php 
echo Form::input(array("name" => "register_name", "placeholder" => "Full name", "value" => $_POST["register_name"]));
?>
                <?php 
if (isset($error["no_name"])) {
    ?>
                    <div class="error">
                        <?php 
    echo $error["no_name"];
    ?>
                    </div>
                <?php 
}
?>
            </div>
            <div class="p">
Esempio n. 9
0
 /**
  * @dataProvider openProvider
  */
 public function testOpen($expected, $method = 'POST', $action = '')
 {
     $this->assertEquals($expected, \Helpers\Form::open($method, $action));
 }
</div> 
                    <div class="panel-body" style="display:none;">
                        <div class="row">
                            <div class="col-xs-2 col-xs-offset-5"><i class="fa fa-circle-o-notch fa-spin fa-5x"></i></div>
                        </div>
                    </div>                   
                    <div id="table" class="table">                                      
                    </div> 
                </div>                            
                <div id="main" class="row">
                    <div class="col-lg-12">
                        <?php 
echo Error::display($error);
?>
                        <?php 
echo Form::open(array('method' => 'post', 'role' => 'form', 'files' => 'files'));
?>
                        
                        <div class="form-group">
                            <label>เลือกภาพสินค้า</label>
                            <input id="fileToUpload" name="fileToUpload" class="form-control" type="file" multiple=true>
                        </div>                        
                        <div class="form-group">
                            <label>ชื่อสินค้า</label>
                            <input name="productName" class="form-control" placeholder="ชื่อสินค้า">
                        </div>
                        <div class="form-group">
                            <label>ราคาสินค้า</label>
                            <input name="productPrice" class="form-control" placeholder="ราคาสินค้า">
                        </div>
                        <div class="form-group">
Esempio n. 11
0
 /**
  * displaySweetsButton
  *
  * display sweets button
  * update/add sweets type
  *
  * @param int $sweet_id (ID of post where sweet is)
  * @param string $sweet_location (Section of site where sweet is)
  * @param int $sweet_owner_userid (ID of user sweeting)
  * @param int $sweet_type (sweet/unsweet)
  * @param int $sweet_sec_id (ID of secondary post)
  * @param string $sweet_url (redirect url)
  *
  * @return string returns sweet button data
  */
 public static function displaySweetsButton($sweet_id = null, $sweet_location = null, $sweet_owner_userid = null, $sweet_sec_id = null, $sweet_url = null)
 {
     // Make sure that there is a user logged in
     if ($sweet_owner_userid != null) {
         // Check to see if current user has already sweeted page
         self::$db = Database::get();
         // Check to see if this is main post
         if ($sweet_sec_id == null) {
             // Sweet is for main post
             $sweet_data = self::$db->select("\n            SELECT\n              *\n            FROM\n              " . PREFIX . "sweets\n            WHERE\n              sweet_id = :sweet_id\n                AND sweet_location = :sweet_location\n                AND sweet_owner_userid = :sweet_owner_userid\n            ", array(':sweet_id' => $sweet_id, ':sweet_location' => $sweet_location, ':sweet_owner_userid' => $sweet_owner_userid));
             // Get count to see if user has already submitted a sweet
             $sweet_count = count($sweet_data);
         } else {
             // Sweet is for secondary post
             $sweet_data = self::$db->select("\n            SELECT\n              *\n            FROM\n              " . PREFIX . "sweets\n            WHERE\n              sweet_id = :sweet_id\n                AND sweet_location = :sweet_location\n                AND sweet_owner_userid = :sweet_owner_userid\n                AND sweet_sec_id = :sweet_sec_id\n            ", array(':sweet_id' => $sweet_id, ':sweet_location' => $sweet_location, ':sweet_owner_userid' => $sweet_owner_userid, ':sweet_sec_id' => $sweet_sec_id));
             // Get count to see if user has already submitted a sweet
             $sweet_count = count($sweet_data);
         }
         //echo " ($sweet_count) ";
         // Setup Sweet Button Form
         $sweet_button_display = Form::open(array('method' => 'post', 'style' => 'display:inline'));
         // Check to see if user has alreadyed sweeted
         if ($sweet_count > 0) {
             // Display UnSweet button if user has already sweeted
             $sweet_button_display .= " <input type='hidden' name='delete_sweet' value='true' /> ";
             $sweet_button_display .= " <input type='hidden' name='sweet_id' value='{$sweet_id}' /> ";
             $sweet_button_display .= " <input type='hidden' name='sweet_sec_id' value='{$sweet_sec_id}' /> ";
             $sweet_button_display .= " <input type='hidden' name='sweet_location' value='{$sweet_location}' /> ";
             $sweet_button_display .= " <input type='hidden' name='sweet_owner_userid' value='{$sweet_owner_userid}' /> ";
             $sweet_button_display .= " <button type='submit' class='btn btn-warning btn-xs' value='Sweet' name='sweet'> Un" . SWEET_BUTTON_DISPLAY . " </button> ";
         } else {
             // Display Sweet Button if user has not yet sweeted
             $sweet_button_display .= " <input type='hidden' name='submit_sweet' value='true' /> ";
             $sweet_button_display .= " <input type='hidden' name='sweet_id' value='{$sweet_id}' /> ";
             $sweet_button_display .= " <input type='hidden' name='sweet_sec_id' value='{$sweet_sec_id}' /> ";
             $sweet_button_display .= " <input type='hidden' name='sweet_location' value='{$sweet_location}' /> ";
             $sweet_button_display .= " <input type='hidden' name='sweet_owner_userid' value='{$sweet_owner_userid}' /> ";
             $sweet_button_display .= " <button type='submit' class='btn btn-success btn-xs' value='Sweet' name='sweet'> " . SWEET_BUTTON_DISPLAY . " </button> ";
         }
         // Close the Sweet Button Form
         $sweet_button_display .= Form::close();
         // Check to see if user is submitting a new sweet
         $submit_sweet = Request::post('submit_sweet');
         $delete_sweet = Request::post('delete_sweet');
         $post_sweet_id = Request::post('sweet_id');
         $post_sweet_location = Request::post('sweet_location');
         $post_sweet_owner_userid = Request::post('sweet_owner_userid');
         $post_sweet_sec_id = Request::post('sweet_sec_id');
         if ($submit_sweet == "true" && $post_sweet_sec_id == $sweet_sec_id) {
             self::addSweet($post_sweet_id, $post_sweet_location, $post_sweet_owner_userid, $post_sweet_sec_id, $sweet_url);
         } else {
             if ($delete_sweet == "true" && $post_sweet_sec_id == $sweet_sec_id) {
                 self::removeSweet($post_sweet_id, $post_sweet_location, $post_sweet_owner_userid, $post_sweet_sec_id, $sweet_url);
             }
         }
         // Ouput the sweet/unsweet button
         return $sweet_button_display;
     }
 }
</h3>
		</div>
		<div class='panel-body'>
			<p><?php 
echo $data['welcome_message'];
?>
</p>
			<table class='table table-striped table-hover table-bordered responsive'>
				<tr>
					<th colspan='2'>Message</th>
          <th><div align='center'><INPUT type='checkbox' onchange='checkAll(this)' name='msg_id[]' /></div></th>
				</tr>
				<?php 
if (!empty($data['messages'])) {
    $this_url = DIR . "Messages{$data['what_box']}";
    echo Form::open(array('method' => 'post', 'action' => $this_url));
    foreach ($data['messages'] as $row) {
        echo "<tr>";
        echo "<td align='center' valign='middle'>";
        //Check to see if message is new
        if ($row->date_read == NULL) {
            // Unread
            echo "<span class='glyphicon glyphicon-star' aria-hidden='true' style='font-size:25px; color:#419641'></span>";
        } else {
            // Read
            echo "<span class='glyphicon glyphicon-star-empty' aria-hidden='true' style='font-size:25px; color:#CCC'></span>";
        }
        echo "</td>";
        echo "<td><a href='" . DIR . "ViewMessage/{$row->id}'><b>Subject:</b> {$row->subject}</a><br>";
        echo $data['tofrom'];
        echo " <a href='" . DIR . "Profile/{$row->username}'>{$row->username}</a>";