コード例 #1
0
 public function login()
 {
     if (!$this->__redirectAccess()) {
         $this->load->helper('form');
         $this->load->library('form_validation');
         $this->form_validation->set_rules('email', 'Email', 'required|valid_email|trim|xss_clean');
         $this->form_validation->set_rules('passcode', 'Passcode', 'trim|required|callback_check_login|xss_clean');
         $this->form_validation->set_message('required', ' error ');
         $this->form_validation->set_error_delimiters('', '');
         if ($this->form_validation->run() === FALSE) {
             loadView('authentication', 'index');
         } else {
             $this->login();
         }
     }
 }
コード例 #2
0
ファイル: Password.php プロジェクト: vishalmote/roadcode
 public function resetShippingUserPass($key)
 {
     if (empty($key)) {
         $newdata = array('error' => "<font color='red'>Invalid Action</font>");
         $this->session->set_flashdata($newdata);
         redirect('/');
     } else {
         $this->load->model('User_model');
         $user = $this->User_model->getUserByKey($key);
         if (count($user) > 0) {
             loadView("resetShippingUserPass", array('user' => $user));
         } else {
             $newdata = array('error' => "<font color='red'>Invalid key or key has been expired.</font>");
             $this->session->set_flashdata($newdata);
             redirect('/');
         }
     }
 }
コード例 #3
0
ファイル: email.php プロジェクト: kaz0636/openflp
 /**
  * Render the contents using the current layout and template.
  *
  * @param string $content Content to render
  * @return string Email ready to be sent
  * @access private
  */
 function __renderTemplate($content)
 {
     $viewClass = $this->Controller->view;
     if ($viewClass != 'View') {
         if (strpos($viewClass, '.') !== false) {
             list($plugin, $viewClass) = explode('.', $viewClass);
         }
         $viewClass = $viewClass . 'View';
         loadView($this->Controller->view);
     }
     $View = new $viewClass($this->Controller, false);
     $View->layout = $this->layout;
     $msg = null;
     if ($this->sendAs === 'both') {
         $htmlContent = $content;
         if (!empty($this->attachments)) {
             $msg .= '--' . $this->__boundary . $this->_newLine;
             $msg .= 'Content-Type: multipart/alternative; boundary="alt-' . $this->__boundary . '"' . $this->_newLine . $this->_newLine;
         }
         $msg .= '--alt-' . $this->__boundary . $this->_newLine;
         $msg .= 'Content-Type: text/plain; charset=' . $this->charset . $this->_newLine;
         $msg .= 'Content-Transfer-Encoding: 7bit' . $this->_newLine . $this->_newLine;
         $content = $View->renderElement('email' . DS . 'text' . DS . $this->template, array('content' => $content), true);
         $View->layoutPath = 'email' . DS . 'text';
         $msg .= $View->renderLayout($content) . $this->_newLine;
         $msg .= $this->_newLine . '--alt-' . $this->__boundary . $this->_newLine;
         $msg .= 'Content-Type: text/html; charset=' . $this->charset . $this->_newLine;
         $msg .= 'Content-Transfer-Encoding: 7bit' . $this->_newLine . $this->_newLine;
         $content = $View->renderElement('email' . DS . 'html' . DS . $this->template, array('content' => $htmlContent), true);
         $View->layoutPath = 'email' . DS . 'html';
         $msg .= $View->renderLayout($content) . $this->_newLine . $this->_newLine;
         $msg .= '--alt-' . $this->__boundary . '--' . $this->_newLine . $this->_newLine;
         return $msg;
     }
     if (!empty($this->attachments)) {
         if ($this->sendAs === 'html') {
             $msg .= $this->_newLine . '--' . $this->__boundary . $this->_newLine;
             $msg .= 'Content-Type: text/html; charset=' . $this->charset . $this->_newLine;
             $msg .= 'Content-Transfer-Encoding: 7bit' . $this->_newLine . $this->_newLine;
         } else {
             $msg .= '--' . $this->__boundary . $this->_newLine;
             $msg .= 'Content-Type: text/plain; charset=' . $this->charset . $this->_newLine;
             $msg .= 'Content-Transfer-Encoding: 7bit' . $this->_newLine . $this->_newLine;
         }
     }
     $content = $View->renderElement('email' . DS . $this->sendAs . DS . $this->template, array('content' => $content), true);
     $View->layoutPath = 'email' . DS . $this->sendAs;
     $msg .= $View->renderLayout($content) . $this->_newLine;
     return $msg;
 }
コード例 #4
0
        $permissionsJoin = $permissionsWhere ? ", `membership_userrecords`" : '';
        // build the count query
        $forcedWhere = $userPCConfig[$ChildTable][$ChildLookupField]['forced-where'];
        $query = preg_replace('/^select .* from /i', 'SELECT count(1) FROM ', $userPCConfig[$ChildTable][$ChildLookupField]['query']) . $permissionsJoin . " WHERE " . ($permissionsWhere ? "( {$permissionsWhere} )" : "( 1=1 )") . " AND " . ($forcedWhere ? "( {$forcedWhere} )" : "( 2=2 )") . " AND " . "`{$ChildTable}`.`{$ChildLookupField}`='" . makeSafe($SelectedID) . "'";
        $totalMatches = sqlValue($query);
        // make sure $Page is <= max pages
        $maxPage = ceil($totalMatches / $userPCConfig[$ChildTable][$ChildLookupField]['records-per-page']);
        if ($Page > $maxPage) {
            $Page = $maxPage;
        }
        // initiate output data array
        $data = array('config' => $userPCConfig[$ChildTable][$ChildLookupField], 'parameters' => array('ChildTable' => $ChildTable, 'ChildLookupField' => $ChildLookupField, 'SelectedID' => $SelectedID, 'Page' => $Page, 'SortBy' => $SortBy, 'SortDirection' => $SortDirection, 'Operation' => 'get-records'), 'records' => array(), 'totalMatches' => $totalMatches);
        // build the data query
        if ($totalMatches) {
            // if we have at least one record, proceed with fetching data
            $startRecord = $userPCConfig[$ChildTable][$ChildLookupField]['records-per-page'] * ($Page - 1);
            $data['query'] = $userPCConfig[$ChildTable][$ChildLookupField]['query'] . $permissionsJoin . " WHERE " . ($permissionsWhere ? "( {$permissionsWhere} )" : "( 1=1 )") . " AND " . ($forcedWhere ? "( {$forcedWhere} )" : "( 2=2 )") . " AND " . "`{$ChildTable}`.`{$ChildLookupField}`='" . makeSafe($SelectedID) . "'" . ($SortBy !== false && $userPCConfig[$ChildTable][$ChildLookupField]['sortable-fields'][$SortBy] ? " ORDER BY {$userPCConfig[$ChildTable][$ChildLookupField]['sortable-fields'][$SortBy]} {$SortDirection}" : '') . " LIMIT {$startRecord}, {$userPCConfig[$ChildTable][$ChildLookupField]['records-per-page']}";
            $res = sql($data['query'], $eo);
            while ($row = db_fetch_row($res)) {
                $data['records'][$row[$userPCConfig[$ChildTable][$ChildLookupField]['child-primary-key-index']]] = $row;
            }
        } else {
            // if no matching records
            $startRecord = 0;
        }
        $response = loadView($userPCConfig[$ChildTable][$ChildLookupField]['template'], $data);
        // change name space to ensure uniqueness
        $uniqueNameSpace = $ChildTable . ucfirst($ChildLookupField) . 'GetRecords';
        echo str_replace("{$ChildTable}GetChildrenRecordsList", $uniqueNameSpace, $response);
        /************************************************/
}
コード例 #5
0
ファイル: index.php プロジェクト: jaflo/hackme
    if (isset($_GET["logout"])) {
        // Delete session, remove cookies to logout
        // http://php.net/manual/en/function.session-destroy.php
        setcookie("id", "", time() - 42000);
        setcookie("username", "", time() - 42000);
        setcookie(session_name(), "", time() - 42000);
        session_destroy();
        redirect("");
    }
    loadView("home");
} else {
    if (isset($_POST["username"]) && isset($_POST["password"])) {
        // Check if user with given credentials exists
        $result = execSQL("SELECT * FROM users WHERE username='******' AND password='******'");
        if ($result->num_rows > 0) {
            // Correct username and password
            while ($row = $result->fetch_assoc()) {
                $expire = 60 * 60 * 12;
                // Cookies expire in 12 hours
                setcookie("id", $row["id"], time() + $expire);
                setcookie("username", $row["username"], time() + $expire);
            }
            redirect("");
        } else {
            redirect("?wrong");
        }
    } else {
        loadView("welcome");
    }
}
include "footer.php";
コード例 #6
0
ファイル: trans_mrs2016.php プロジェクト: bigprof/jaap
/**
 * Called after executing the insert query (but before executing the ownership insert query).
 * 
 * @param $data
 * An associative array where the keys are field names and the values are the field data values that were inserted into the new record.
 * For this table, the array items are: 
 *     $data['firstname'], $data['lastname'], $data['email'], $data['phone'], $data['quantity'], $data['amount'], $data['mailinglist'], $data['remarks'], $data['transactiondate'], $data['seller'], $data['editingdate'], $data['editor']
 * Also includes the item $data['selectedID'] which stores the value of the primary key for the new record.
 * 
 * @param $memberInfo
 * An array containing logged member's info.
 * @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/memberInfo
 * 
 * @param $args
 * An empty array that is passed by reference. It's currently not used but is reserved for future uses.
 * 
 * @return
 * A boolean TRUE to perform the ownership insert operation or FALSE to cancel it.
 * Warning: if a FALSE is returned, the new record will have no ownership info.
 */
function trans_mrs2016_after_insert($data, $memberInfo, &$args)
{
    /* check if user add quantity value or not */
    if (!$data['quantity']) {
        return FALSE;
    }
    /* create child records in duck_mrs2016 table after inserting parent */
    $transaction_id = $data['transaction_id'];
    $creation_date = date("j-n-Y");
    $table_name = 'duck_mrs2016';
    /* member info */
    $member_id = $memberInfo['username'];
    $group_id = $memberInfo['groupID'];
    $date_updated = $date_added = time();
    /* array to insert all ducks in duck_mrs2016 table  */
    $sql_to_duck_mrs2016 = array();
    /* array to insert all ducks in membership_userrecords table  */
    $sql_to_membership_userrecords = array();
    /* get last inserted id in duck_mrs2016 table to calculate pks */
    $duck_id = sqlValue("select max(duck_id) from `duck_mrs2016`");
    /* list of all duck id's */
    $duck_ids = array();
    for ($i = 0; $i < $data['quantity']; $i++) {
        $sql_to_duck_mrs2016[] = "('{$transaction_id}','{$creation_date}')";
        /* check if there is value of duck_id */
        $pk = empty($duck_id) ? $i + 1 : $duck_id + $i + 1;
        $sql_to_membership_userrecords[] = "('{$table_name}','{$pk}','{$member_id}','{$date_added}','{$date_updated}','{$creation_date}')";
        $duck_ids[] = $pk;
    }
    sql("INSERT INTO `duck_mrs2016` (`transaction_id`,`creationdate`) VALUES " . implode(',', $sql_to_duck_mrs2016), $eo);
    sql("INSERT INTO `membership_userrecords`(`tableName`, `pkValue`, `memberID`, `dateAdded`, `dateUpdated`, `groupID`) VALUES " . implode(',', $sql_to_membership_userrecords), $eo);
    /* prepare list of duck IDs for email */
    $data['duck_ids'] = implode(' - ', $duck_ids);
    /* seller's full name */
    $data['seller_full_name'] = $memberInfo['custom'][0];
    /**
     * send an email when a new transaction is placed. 
     **/
    /* define associative array $mail_info to pass it to smtp_mail fn to send mail */
    $mail_info = array('cc' => $memberInfo['email'], 'to' => $data['email'], 'message' => loadView('email-to-buyer', $data), 'subject' => "Badeendrace 2016");
    /* send notification mail to seller and buyer */
    smtp_mail($mail_info);
    return TRUE;
}
コード例 #7
0
ファイル: page-arrays.php プロジェクト: diductio/D
				<div class="stat-col">
					<a href="<?php 
echo get_site_url();
?>
">
						<span class="label label-success label-soft">Массивы</span>
						<span class="label label-success"><?php 
echo $st->get_all_arrays();
?>
</span>
					</a>
				</div>
				<?php 
if (function_exists('loadView')) {
    $data->class = "label-soft";
    loadView('my', $data);
}
?>
				<div class="stat-col">
					<a href="/array-active">
						<span class="label label-success 
							<?php 
if (!is_page('array-active')) {
    ?>
label-soft<?php 
}
?>
 ">Проходят</span>
						<span class="label label-success"><?php 
echo $st->active;
?>
コード例 #8
0
ファイル: signup.php プロジェクト: arjayads/php-simple-auth
        } else {
            if (strcmp($_POST['member']['password'], $_POST['member']['password_confirmation']) !== 0) {
                $errors[] = 'Password confirmation does not matched with Password';
            }
        }
        if (count($errors) > 0) {
            $data['member'] = $_POST['member'];
            $data['errors'] = $errors;
            loadView('_signup_form.php', $data);
        } else {
            $u = new User();
            $u->isActive = false;
            $u->email = $_POST['member']['email'];
            $u->firstName = $_POST['member']['first_name'];
            $u->lastName = $_POST['member']['last_name'];
            $u->password = $_POST['member']['password'];
            $result = $u->save();
            if ($result) {
                $result->sendActivationEmail();
                Session::putFlash(['success' => "Sign-up successful. An email is sent to you to activate your account before you can sign-in"]);
                redirect("/session.php");
            } else {
                $data['member'] = $_POST['member'];
                $data['errors'] = ['Something went wrong'];
                loadView('_signup_form.php', $data);
            }
        }
    } else {
        loadView('_signup_form.php');
    }
}
コード例 #9
0
 /**
  * Enter description here...
  *
  * @param unknown_type $action
  * @param unknown_type $layout
  * @param unknown_type $file
  * @return unknown
  */
 function render($action = null, $layout = null, $file = null)
 {
     $viewClass = $this->view;
     if ($this->view != 'View') {
         $viewClass = $this->view . 'View';
         loadView($this->view);
     }
     $this->beforeRender();
     $ctrl =& $this->controller;
     $ctrl->layout = $this->layout;
     $ctrl->viewPath = Inflector::underscore($this->name);
     $ctrl->set($this->data);
     $this->_viewClass =& new $viewClass($ctrl);
     return $this->_viewClass->render($action, $layout, $action . '.text.plain');
 }
コード例 #10
0
ファイル: page-subscribers.php プロジェクト: diductio/D
					<div class="entry-content all-users">
						
							<?php 
// User Loop
if (!empty($user_query->results)) {
    foreach ($user_query->results as $user) {
        get_template_part('content', 'peoples');
    }
} else {
    echo 'No users found.';
}
?>
					</div>
					<?php 
if (function_exists('loadView')) {
    loadView('my-taxonomies', $data);
}
?>
				</header>
			</article>
			<?php 
// grab the current query parameters
$query_string = $_SERVER['QUERY_STRING'];
// The $base variable stores the complete URL to our page, including the current page arg
// if in the admin, your base should be the admin URL + your page
// $base = 'http://5.178.82.26/lyudi/' . remove_query_arg('p', $query_string) . '%_%';
$paginate_url = home_url() . "/people/page/";
// if on the front end, your base is the current page
//$base = get_permalink( get_the_ID() ) . '?' . remove_query_arg('p', $query_string) . '%_%';
$page_args = array('base' => str_replace($big = 999999999, '%#%', $paginate_url . $big), 'format' => '&p=%#%', 'prev_text' => __('&laquo; Previous'), 'next_text' => __('Next &raquo;'), 'total' => $total_pages, 'current' => $page, 'end_size' => 1, 'mid_size' => 5);
?>
コード例 #11
0
ファイル: diductio-subsriber.php プロジェクト: diductio/D
function diductio_subsriber_options()
{
    $data = new stdClass();
    $data->test = 'test';
    loadView('subscriber-options', $data);
}
コード例 #12
0
ファイル: login.php プロジェクト: davidhurtado/ranking
//Cargar las vistas o templates dependiendo del userLogged -->
if (!$G->user->isLogged()) {
    // Gestionar los errores del formulario de login -->
    $G->error = "ok";
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        if (!empty($_POST['user']) && !empty($_POST['pass'])) {
            // Recoger los datos del form -->
            $user = htmlspecialchars(trim($_POST['user']));
            $password = htmlspecialchars(trim($_POST['pass']));
            $password_hashed = hash("sha256", $password);
            //Existe el usuario?
            if ($existData = $G->user->exists(0, $user)) {
                if ($existData["u_password"] == $password_hashed) {
                    $G->user->loadData($existData);
                    $insert_query = $G->db->prepare("UPDATE " . DB_PREFIX . "usuarios set u_sesion=1 WHERE u_id=" . $_SESSION["id"] . " AND u_nick='" . $_SESSION["user"] . "'");
                    $insert_query->execute();
                    redirectTo("home");
                } else {
                    $G->error = "La contrase&ntilde;a ingresa es incorrecta.";
                }
            } else {
                $G->error = "El usuario al que intenta acceder no existe!";
            }
        } else {
            $G->error = "Debe completar todos los campos.";
        }
    }
    loadView("login.phtml");
} else {
    redirectTo("home");
}
コード例 #13
0
ファイル: controller.php プロジェクト: carriercomm/pastebin-5
 /**
  * Gets an instance of the view object and prepares it for rendering the output, then
  * asks the view to actualy do the job.
  *
  * @param string $action
  * @param string $layout
  * @param string $file
  * @return controllers related views
  * @access public
  */
 function render($action = null, $layout = null, $file = null)
 {
     $viewClass = $this->view;
     if ($this->view != 'View') {
         $viewClass = $this->view . 'View';
         loadView($this->view);
     }
     $this->beforeRender();
     $this->__viewClass =& new $viewClass($this);
     if (!empty($this->modelNames)) {
         foreach ($this->modelNames as $model) {
             if (!empty($this->{$model}->validationErrors)) {
                 $this->__viewClass->validationErrors[$model] =& $this->{$model}->validationErrors;
             }
         }
     }
     $this->autoRender = false;
     return $this->__viewClass->render($action, $layout, $file);
 }
コード例 #14
0
ファイル: camiones.php プロジェクト: davidhurtado/ranking
 * Time: 11:06
 */
if (!$G->user->isLogged()) {
    redirectTo("login");
} else {
    $G->error = "ok";
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        if (!empty($_POST["matricula"])) {
            $matricula = !empty($_POST["matricula"]) ? trim($_POST["matricula"]) : ($G->error .= "Falta matricula.<br/>");
            $modelo = !empty($_POST["modelo"]) ? trim($_POST["modelo"]) : ($G->error .= "Falta modelo.<br/>");
            $tipo = !empty($_POST["tipo"]) ? trim($_POST["tipo"]) : ($G->error .= "Falta tipo.<br/>");
            $potencia = !empty($_POST["potencia"]) ? trim($_POST["potencia"]) : ($G->error .= "Falta potencia.<br/>");
            //$camionero = !empty($_POST["camionero"]) ? trim($_POST["camionero"]) : ($G->error .= "Falta cedula del camionero.<br/>");
            if ($G->error == "ok") {
                $insert_query = $G->db->prepare("INSERT INTO " . DB_PREFIX . "camiones (c_matricula, c_modelo, c_tipo, c_potencia)\n            VALUES (?, ?, ?, ?)");
                $insert_query->execute(array($matricula, $modelo, $tipo, $potencia));
            }
        }
    }
    //Cargar los registros -->
    $query = $G->db->prepare("SELECT * FROM " . DB_PREFIX . "camiones ORDER BY cid ASC");
    $query->execute();
    //Existen registros?
    if ($query->rowCount()) {
        $G->camiones = $query->fetchAll();
    } else {
        $G->camiones = null;
    }
    $G->act = isset($_GET["act"]) ? trim($_GET["act"]) : "registros";
    loadView('logged/camiones.phtml');
}
コード例 #15
0
ファイル: homepage.php プロジェクト: RuseHackV2/CinePal
<?php

/**
 * Created by PhpStorm.
 * User: Pavel
 * Date: 2015-11-06
 * Time: 8:09 PM
 */
?>

<?php 
echo loadView('navbar');
echo loadView('homepage/jumbotron');
echo loadView('homepage/recents');
コード例 #16
0
ファイル: handler.php プロジェクト: smsorange/api-library
    if ($bookingStep == 'GetCabins') {
        setcookie('category-code', $data['category-code']);
    }
    if ($bookingStep == 'HoldCabin') {
        setcookie('cabin-code', $data['cabin_number']);
        setcookie('dining-preference', $data['dining_preference']);
    }
    /*
    |--------------------------------------------------------------------------
    | Response
    |--------------------------------------------------------------------------
    |
    | We get the API response trough the Unirest library.
    |
    | Available properties are:
    |
    | $response->code      --  HTTP Status code
    | $response->headers   --  Headers
    | $response->body      --  Parsed body
    | $response->raw_body  --  Unparsed body
    |
    | For the purpose of demonstration, we will use $response->body in this example,
    | although you could preferably use 'raw_body' and deal with the plain JSON instead
    | trough javascript/AJAX, for a better UX.
    |
    */
    $response = $dispatcher->{$bookingStep}($_POST);
    $dump = is_object($response->body) ? $response->body : $response->body[0];
    $output = ['result' => loadView("{$serviceName}/{$_POST['webservice']}/{$bookingStep}.php", $response->body, $containerName), 'dump' => varDumpToString($dump)];
    exit(json_encode($output));
}
コード例 #17
0
ファイル: session.php プロジェクト: arjayads/php-simple-auth
        if (isset($_POST['signin'])) {
            $errors = [];
            if (!isset($_POST['session']['email'])) {
                $errors[] = 'Input email';
            }
            if (count($errors) > 0) {
                $data['errors'] = $errors;
                $data['session'] = $_POST['session'];
                loadView('_signin_form.php', $data);
            } else {
                $user = new User();
                $user = $user->findOneBy("email = '" . $_POST['session']['email'] . "'");
                if ($user && $user->isActive && $user->isAuthenticated('password', $_POST['session']['password'])) {
                    Session::logIn($user);
                    if (isset($_POST['session']['remember_me']) && $_POST['session']['remember_me'] == '1') {
                        Session::remember($user);
                    } else {
                        Session::forget($user);
                    }
                    Session::redirectBackOr('profile.php');
                } else {
                    $data['session'] = $_POST['session'];
                    $data['errors'] = ['Invalid email and password combination'];
                    loadView('_signin_form.php', $data);
                }
            }
        } else {
            loadView('_signin_form.php');
        }
    }
}
コード例 #18
0
                            $user->save();
                            Session::putFlash(['success' => 'Password has been reset.']);
                            redirect('session.php');
                        }
                    }
                    $data['errors'] = ["User not found!"];
                    loadView('_password_reset_confirm.php', $data);
                }
            }
        } else {
            $errors[] = "Email can't be blank";
        }
    }
} else {
    if (isset($_GET['token']) && isset($_GET['email'])) {
        // password reset link click from email
        $user = getUser($_GET['email']);
        if ($user && $user->isActive && $user->isAuthenticated('reset', $_GET['token'])) {
            $data['email'] = $_GET['email'];
            $data['token'] = $_GET['token'];
            loadView('_password_reset_confirm.php', $data);
            exit;
        } else {
            redirect("/");
        }
    }
}
// default
$data['errors'] = $errors ? $errors : [];
loadView('_password_reset_email.php', $data);
コード例 #19
0
ファイル: preferences.php プロジェクト: RuseHackV2/CinePal
<?php

/**
 * Created by PhpStorm.
 * User: Pavel
 * Date: 2015-11-08
 * Time: 12:11 PM
 */
?>

<?php 
echo loadView('navbar');
?>

<script type="text/javascript">
    $(document).ready(function() {
        var max = 0;
        $('.search-box').each(function (){
            if($(this).height() > max) max = $(this).height();
        });
        $('.search-box').each(function () {
            $(this).css('height',(max+10)+'px');
        });
    });
</script>

<div >
    <div class="page-header" style="border:0;">
        <h1>My Watched/Disliked list</h1>
    </div>
    <?php 
コード例 #20
0
ファイル: home.php プロジェクト: jaflo/hackme
<?php

loadView("start");
?>
<h2>Home</h2>
<form method="post" action="<?php 
url("post.php");
?>
" id="share">
	<textarea name="content" placeholder="Share something!"></textarea>
	<input name="color" type="text" />
	<button type="submit">Share</button>
</form>
<div id="posts">
<?php 
// Get the newest 50 posts
$posts = execSQL("SELECT * FROM posts ORDER BY created DESC LIMIT 50");
if ($posts->num_rows > 0) {
    // Loop through the posts
    while ($post = $posts->fetch_assoc()) {
        ?>
	<div id="<?php 
        echo $post["id"];
        ?>
">
		<div class="sideline" style="border-color:<?php 
        echo $post["color"];
        ?>
"></div>
		<div class="profileimage" style="background-image:url(<?php 
        echo getUser($post["username"])["profileimage"];
コード例 #21
0
                    icon: "<?php 
echo base_url('static/lib/ios-overlay/img/check.png');
?>
"
                });
            }
        });
        req.fail(function () {
            iosOverlay({
                text: "Error",
                duration: 2e3,
                icon: "<?php 
echo base_url('static/lib/ios-overlay/img/check.png');
?>
"
            });
        });
    }
</script>

<div id="content">
    <?php 
if (isset($error)) {
    echo '<div class="alert alert-danger" style="margin-top:20px;">' . $error . '</div>';
} else {
    echo loadView('recommendation/movie_details');
    echo loadView('recommendation/movie_recommendations');
}
?>
</div>
コード例 #22
0
ファイル: basico_helper.php プロジェクト: CodeInUFPel/kenobi
/**
 * Carrega o rodapé padrão da página.<br/>
 * Exemplo de uso (no final da página):<br/>
 * <code>
 *  <?=footerView()?>
 * </code>
 * @return view A view de rodapé carregada
 */
function footerView()
{
    return loadView("rodapeView");
}
コード例 #23
0
ファイル: incCommon.php プロジェクト: WebxOne/fwldba
/**
 * Loads a table template from the templates folder, passing the given data to it
 * @param $table_name the name of the table whose template is to be loaded from the 'templates' folder
 * @param $the_data_to_pass_to_the_table associative array containing the data to pass to the table template
 * @return the output of the parsed table template as a string
 */
function loadTable($table_name, $the_data_to_pass_to_the_table = array())
{
    $dont_load_header = $the_data_to_pass_to_the_table['dont_load_header'];
    $dont_load_footer = $the_data_to_pass_to_the_table['dont_load_footer'];
    $header = $table = $footer = '';
    if (!$dont_load_header) {
        // try to load tablename-header
        if (!($header = loadView("{$table_name}-header", $the_data_to_pass_to_the_table))) {
            $header = loadView('table-common-header', $the_data_to_pass_to_the_table);
        }
    }
    $table = loadView($table_name, $the_data_to_pass_to_the_table);
    if (!$dont_load_footer) {
        // try to load tablename-footer
        if (!($footer = loadView("{$table_name}-footer", $the_data_to_pass_to_the_table))) {
            $footer = loadView('table-common-footer', $the_data_to_pass_to_the_table);
        }
    }
    return "{$header}{$table}{$footer}";
}
コード例 #24
0
ファイル: usuarios.php プロジェクト: davidhurtado/ranking
        if ($_SERVER["REQUEST_METHOD"] == "GET") {
            if ($G->act == 'editar') {
                if (!empty($_GET["id"])) {
                    $uid = $_GET["id"];
                    //Cargar los registros -->
                    $query = $G->db->prepare("SELECT * FROM " . DB_PREFIX . "usuarios WHERE u_id=" . $uid);
                    $query->execute();
                    //Existen registros?
                    if ($query->rowCount()) {
                        $G->usuariosEditar = $query->fetchAll();
                    } else {
                        $G->usuariosEditar = null;
                        redirectTo('lista');
                    }
                }
            }
        }
        //Cargar los registros -->
        $queryUs = $G->db->prepare("SELECT * FROM " . DB_PREFIX . "usuarios ORDER BY u_id ASC");
        $queryUs->execute();
        //Existen registros?
        if ($queryUs->rowCount()) {
            $G->usuarios = $queryUs->fetchAll();
        } else {
            $G->usuarios = null;
        }
        loadView('home.phtml');
    } else {
        redirectTo($G->config["w_url"] . DS . 'logout');
    }
}
コード例 #25
0
ファイル: index.php プロジェクト: andteki/compsa
<?php

require_once "inc/init.php";
loadView();
コード例 #26
0
ファイル: news.php プロジェクト: arjayads/php-simple-auth
<?php

require_once '_common.inc.php';
require_once '_auth.inc.php';
loadView('_news.php');
コード例 #27
0
ファイル: index.php プロジェクト: arjayads/php-simple-auth
<?php

require_once '_common.inc.php';
if (Session::isLoggedIn()) {
    redirect("profile.php");
}
loadView('_index.php');
コード例 #28
0
ファイル: controller.php プロジェクト: venka10/RUS
 /**
  * Gets an instance of the view object and prepares it for rendering the output, then
  * asks the view to actualy do the job.
  *
  * @param string $action
  * @param string $layout
  * @param string $file
  * @return controllers related views
  * @access public
  */
 function render($action = null, $layout = null, $file = null)
 {
     $viewClass = $this->view;
     if ($this->view != 'View') {
         $viewClass = $this->view . 'View';
         loadView($this->view);
     }
     $this->beforeRender();
     $this->__viewClass =& new $viewClass($this);
     if (!empty($this->modelNames)) {
         $models = array();
         foreach ($this->modelNames as $currentModel) {
             if (isset($this->{$currentModel}) && is_a($this->{$currentModel}, 'Model')) {
                 $models[] = Inflector::underscore($currentModel);
             }
             if (isset($this->{$currentModel}) && is_a($this->{$currentModel}, 'Model') && !empty($this->{$currentModel}->validationErrors)) {
                 $this->__viewClass->validationErrors[Inflector::camelize($currentModel)] =& $this->{$currentModel}->validationErrors;
             }
         }
         $models = array_diff(ClassRegistry::keys(), $models);
         foreach ($models as $currentModel) {
             if (ClassRegistry::isKeySet($currentModel)) {
                 $currentObject =& ClassRegistry::getObject($currentModel);
                 if (is_a($currentObject, 'Model') && !empty($currentObject->validationErrors)) {
                     $this->__viewClass->validationErrors[Inflector::camelize($currentModel)] =& $currentObject->validationErrors;
                 }
             }
         }
     }
     $this->autoRender = false;
     return $this->__viewClass->render($action, $layout, $file);
 }
コード例 #29
0
ファイル: registro.php プロジェクト: davidhurtado/ranking
            }
            redirectTo("lista");
        }
        if ($G->act == 'editar') {
            if (!empty($_GET["id"])) {
                $uid = $_GET["id"];
                //Cargar los registros -->
                $query = $G->db->prepare("SELECT * FROM " . DB_PREFIX . "usuarios WHERE u_id=" . $uid);
                $query->execute();
                //Existen registros?
                if ($query->rowCount()) {
                    $G->usuariosEditar = $query->fetchAll();
                } else {
                    $G->usuariosEditar = null;
                    redirectTo('lista');
                }
            }
        }
    }
    //Cargar los registros -->
    $queryUs = $G->db->prepare("SELECT * FROM " . DB_PREFIX . "usuarios ORDER BY u_id ASC");
    $queryUs->execute();
    //Existen registros?
    if ($queryUs->rowCount()) {
        $G->usuarios = $queryUs->fetchAll();
    } else {
        $G->usuarios = null;
    }
    loadView('guest/registrarse.phtml');
    //
}
コード例 #30
0
ファイル: Dashboard.php プロジェクト: vishalmote/roadcode
 public function index()
 {
     loadView('index');
 }