Ejemplo n.º 1
0
 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');
 }
Ejemplo n.º 2
0
    ?>
" style="border: 4px solid #e5e5e5;">
              <h4><?php 
    echo $p['name'];
    ?>
</h4>
              <p><?php 
    echo $p['description'];
    ?>
</p>
              <?php 
    if (isset($p['attributes'])) {
        ?>
                Choose: &nbsp;
                <?php 
        \Helpers\Form::create_attributes_for_kit($p['attributes'], 'product_' . md5($p['id']) . '_attr_');
        ?>
              <?php 
    }
    ?>
            </div>
          <?php 
}
?>

          <input type="hidden" name="type" value="kit">
          <input type="hidden" name="action" value="add">
          <input type="hidden" name="id" value="<?php 
echo $kit['id'];
?>
">
Ejemplo n.º 3
0
        <label class="control-label"> Address2:</label>
        <?php 
\Helpers\Form::create_input('shipping_address2', 'text', $errors, $values = 'SESSION', array('class' => 'input-xlarge'));
?>
      </div>
      <div class="control-group">
        <label class="control-label"><span class="red">*</span> City:</label>
        <?php 
\Helpers\Form::create_input('shipping_city', 'text', $errors, $values = 'SESSION', array('class' => 'input-xlarge'));
?>
      </div>
      <div class="control-group">
        <label class="control-label"><span class="red">*</span> State:</label>
        <?php 
\Helpers\Form::create_input('shipping_state', 'select', $errors, $values = 'SESSION');
?>
      </div>
      <div class="control-group">
        <label class="control-label"><span class="zip_code">*</span> Zip Code:</label>
        <?php 
\Helpers\Form::create_input('shipping_zip_code', 'text', $errors, $values = 'SESSION', array('class' => 'input-xlarge'));
?>
      </div>
      <?php 
\Helpers\Form::create_input('use_same_address', 'checkbox', $errors, $values = 'SESSION', array('class' => 'input-xlarge'));
?>
      <small>Use Same Address for Billing?</small>
    </fieldset>
  </div>
</div>
Ejemplo n.º 4
0
$this->title = 'Change Password';
$this->breadcrumb = [['label' => 'My Profile', 'url' => ['index']], ['label' => $this->title]];
?>

<div class="main-title">
    <h1><?php 
echo $this->title;
?>
</h1>
</div>

<div class="row">
    <div class="col-sm-6 col-sm-offset-3">

    <?php 
echo $form = new Form();
?>
    <?php 
echo $form->password($model, 'Password');
?>
    <?php 
echo $form->password($model, 'Password2');
?>
    <?php 
echo $form->submitButton('Submit');
?>
    <?php 
echo $form->end();
?>

  </div>
Ejemplo n.º 5
0
        <div class="row">
            <div class="col-md-offset-4 col-md-4">
                <label for="seasonId">Season: </label>
                <?php 
echo \helpers\Form::select(array('name' => 'seasonId', 'id' => 'seasonId', 'class' => 'form-control', 'data' => $data['season_names']));
?>
            </div>
        </div>
    </div>

    <div id="hometownDiv" class="form-group">
        <div class="row">
            <div class="col-md-offset-4 col-md-4">
                <label for="hometown">Hometown: </label>
                <?php 
echo \helpers\Form::input(array('name' => 'hometown', 'id' => 'hometown', 'class' => 'form-control', 'placeholder' => 'City, State'));
?>
            </div>
        </div>
    </div>

    <div id="schoolYearDiv" class="form-group">
        <div class="row">
            <div class="col-md-offset-4 col-md-4">
                <label for="schoolYear">Year in School: </label>
                <select id="schoolYear" name="schoolYear" class="form-control">
                    <option value="">Select</option>
                    <option value="Freshman">Freshmen</option>
                    <option value="Sophomore">Sophomore</option>
                    <option value="Junior">Junior</option>
                    <option value="Senior">Senior</option>
Ejemplo n.º 6
0
$this->title = 'Login';
$this->breadcrumb = [['label' => $this->title]];
?>

<div class="main-title">
    <h1><?php 
echo $this->title;
?>
</h1>
</div>

<div class="row">
    <div class="col-sm-6 col-sm-offset-3">

    <?php 
echo $form = new Form();
?>
    <?php 
echo $form->label('Username or Email')->inputText($model, 'Username');
?>
    <?php 
echo $form->password($model, 'Password');
?>
    <?php 
echo $form->checkBox($model, 'rememberMe');
?>
    <p class="text-right">
        <?php 
echo BaseHtml::a('Forgot your password?‎', ['reset-password']);
?>
<br />
Ejemplo n.º 7
0
\Helpers\Form::create_input('billing_address1', 'text', $errors, $values = 'SESSION', array('class' => 'input-xlarge'));
?>
      </div>
      <div class="control-group">
        <label class="control-label"> Address2:</label>
        <?php 
\Helpers\Form::create_input('billing_address2', 'text', $errors, $values = 'SESSION', array('class' => 'input-xlarge'));
?>
      </div>
      <div class="control-group">
        <label class="control-label"><span class="red">*</span> City:</label>
        <?php 
\Helpers\Form::create_input('billing_city', 'text', $errors, $values = 'SESSION', array('class' => 'input-xlarge'));
?>
      </div>
      <div class="control-group">
        <label class="control-label"><span class="red">*</span> State:</label>
        <?php 
\Helpers\Form::create_input('billing_state', 'select', $errors, $values = 'SESSION');
?>
      </div>
      <div class="control-group">
        <label class="control-label"><span class="zip_code">*</span> Zip Code:</label>
        <?php 
\Helpers\Form::create_input('billing_zip_code', 'text', $errors, $values = 'SESSION', array('class' => 'input-xlarge'));
?>
      </div>
    </fieldset>
  </div>
</div>
Ejemplo n.º 8
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;
     }
 }
Ejemplo n.º 9
0
          <?php 
\Helpers\Form::create_input('password', 'password', $errors, $values = 'SESSION', array('class' => 'input-xlarge', 'others' => 'placeholder="' . $this->tr('session.view.change.current') . '"'));
?>
        </div>
        <div class="control-group">
          <?php 
\Helpers\Form::create_input('new_password', 'password', $errors, $values = 'SESSION', array('class' => 'input-xlarge', 'others' => 'placeholder="' . $this->tr('session.view.change.new') . '"'));
?>
          <span class="info"><small><?php 
echo $this->tr('session.view.register.password.explanation');
?>
</small></span>
        </div>
        <div class="control-group">
          <?php 
\Helpers\Form::create_input('new_password_confirmation', 'password', $errors, $values = 'SESSION', array('class' => 'input-xlarge', 'others' => 'placeholder="' . $this->tr('session.view.change.confirmation') . '"'));
?>
        </div>
      </fieldset>
    </div>
    <div class="pull-right">
      <input type="submit" class="submit" value="<?php 
echo $this->tr('session.view.change.button.label');
?>
 &rarr;">
    </div>
  </form>
  <div style="clear:both; display:block; height:40px"></div>
</div>

Ejemplo n.º 10
0
$this->title = 'Reset Password';
$this->breadcrumb = [['label' => $this->title]];
?>

<div class="main-title">
    <h1><?php 
echo $this->title;
?>
</h1>
</div>

<div class="row">
    <div class="col-sm-6 col-sm-offset-3">

    <?php 
echo $form = new Form();
?>
    <?php 
echo $form->inputText($model, 'Email');
?>
    <?php 
echo $form->inputText($model, 'Email2');
?>
    <?php 
echo $form->submitButton('Reset Password');
?>
    <?php 
echo $form->end();
?>

  </div>
Ejemplo n.º 11
0
$this->title = 'Register';
$this->breadcrumb = [['label' => $this->title]];
?>

<div class="main-title">
    <h1><?php 
echo $this->title;
?>
</h1>
</div>

<div class="row">
    <div class="col-sm-6 col-sm-offset-3">

    <?php 
echo $form = new Form();
?>
    <?php 
echo $form->inputText($model, 'Username');
?>
    <?php 
echo $form->inputText($model, 'Email');
?>
    <?php 
echo $form->password($model, 'Password');
?>
    <?php 
echo $form->password($model, 'Password2');
?>
    <p class="text-right">
        <?php 
Ejemplo n.º 12
0
?>
</h2>
      <?php 
echo \Helpers\Util::get_price($row['price'], $row['sale_price']);
?>
      <?php 
if (isset($attributes)) {
    ?>
        <form method="post" action="<?php 
    echo $this->url('/shop/add_product');
    ?>
">
          <fieldset>
            Choose: &nbsp;
            <?php 
    \Helpers\Form::create_attributes($attributes);
    ?>
            <input type="hidden" name="action" value="add">
            <input type="hidden" name="id" value="<?php 
    echo $row['id'];
    ?>
">
            <br /><br />
            <span class="buttons">
              <input type="submit" name="cart" value="Add to Cart">
              <input type="submit" name="wishlist" value="Add to Wishlist">
            </span>
          </fieldset>
        </form>
      <?php 
} else {
Ejemplo n.º 13
0
?>
 &nbsp;
    <small><?php 
echo $this->tr('session.view.forgot.header.explanation');
?>
</small>
  </h2>
    <form action="<?php 
$this->url('/session/forgotpassword');
?>
" method="post" class="form-register">
    <div class="registerbox">
      <fieldset>
        <div class="control-group">
          <?php 
\Helpers\Form::create_input('email', 'text', $errors, $values = 'SESSION', array('class' => 'input-xlarge', 'others' => 'placeholder="' . $this->tr('session.view.forgot.email.placeholder') . '"'));
?>
 </div>
      </fieldset>
    </div>
    <div class="pull-right">
      <input type="submit" class="submit" value="<?php 
echo $this->tr('session.view.forgot.button.label');
?>
 &rarr;">
    </div>
  </form>
  <div style="clear:both; display:block; height:40px"></div>
</div>

Ejemplo n.º 14
0
              <div class="control-group">
                <label for="select01" class="control-label"> <?php 
echo $this->tr('session.view.register.country');
?>
:</label>
                <?php 
\Helpers\Form::create_input('country', 'select', $errors, $values = 'SESSION');
?>
              </div>
              <div class="control-group">
                <label class="control-label"> <?php 
echo $this->tr('session.view.register.state');
?>
:</label>
                <?php 
\Helpers\Form::create_input('state', 'select', $errors, $values = 'SESSION');
?>
              </div>
            </fieldset>
          </div>
          <div class="pull-right">
            <label class="checkbox inline">
              <input type="checkbox" name="terms" />
            </label>
            <?php 
echo $this->tr('session.view.register.policy.label');
?>
 <a href="<?php 
echo $this->url('/home/privacy');
?>
" ><?php 
Ejemplo n.º 15
0
 /**
  * @dataProvider selectMultipleTrueAndOpntionsProvider
  */
 public function testSelectMultipleTrueAndOptions($expected, $name, array $options = [], $value = null, $multiple = true)
 {
     $this->assertEquals($expected, \Helpers\Form::select($name, $options, $value, $multiple));
 }
Ejemplo n.º 16
0
      <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' => 'content', 'class' => 'form-control', 'value' => $data['content'], 'placeholder' => 'Message Content', 'rows' => '6'));
    ?>
      </div>

        <!-- CSRF Token -->
        <input type="hidden" name="csrf_token" value="<?php 
    echo $data['csrf_token'];
    ?>
" />
        <button class="btn btn-md btn-success" name="submit" type="submit">
          <?php 
    // echo Language::show('update_profile', 'Auth');
    ?>
          Send Message
        </button>
      <?php 
    echo Form::close();
    ?>

<?php 
    // END Check to see if message form is disabled
}
?>

		</div>
	</div>
</div>
Ejemplo n.º 17
0
use helpers\Form;
$this->title = 'Update: ' . $model->Username;
$this->breadcrumb = [['label' => 'Users', 'url' => ['index']], ['label' => $model->Username, 'url' => ['view', $model->Username]], ['label' => $this->title]];
?>

<div class="main-title">
    <h1><?php 
echo $this->title;
?>
</h1>
</div>

<div class="row">
    <div class="col-sm-6 col-sm-offset-3">
        <?php 
echo $form = new Form();
?>
        <?php 
echo $form->inputText($model, 'Username');
?>
        <?php 
echo $form->inputText($model, 'Email');
?>
        <?php 
echo $form->checkBox($model, 'Activated');
?>
        <?php 
echo $form->select($model, 'GroupID', $model->dataRoles);
?>
        <?php 
echo $form->submitButton('Update');