Yii Framework Forum: After Login Redirecting To Home Page - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

After Login Redirecting To Home Page

#1 User is offline   vaijanath 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 09-October 13
  • Location:Bengaluru

Posted 09 June 2014 - 03:38 AM

Hello, I'm developing a web application using yii. I'm using other template called "admin_theme" which i included in "themes" directory and mentioned in protected/config/main.php as 'theme'=>'admin_theme', it works fine. When i open it in browser as "localhost/ksoca_reports/", first it should display login page. If login is details are correct, then it should redirect to the homepage.I have a sign in code as follows :
Sign in page code(signin.php) :
<div class="form-box" id="login-box">
<div class="header">KSOCA</div>
<form action="<?php echo Yii::app()->theme->baseUrl; ?>/" method="post">
<div class="body bg-gray">
<div class="form-group">
<input type="text" class="form-control" placeholder="Email address / User id" required autofocus/>
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" required/>
</div>
<div class="form-group">
<input type="checkbox" name="remember_me"/> Remember me
</div>
</div>
<div class="footer">
<button type="submit" class="btn bg-olive btn-block">Sign in</button>
</div>
</form>
</div>



my home page code(home.php) :

<header class="header">
<a href="#" class="logo">KSOCA</a>
<nav class="navbar navbar-static-top" role="navigation">
<a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="navbar-right">
<ul class="nav navbar-nav">
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="glyphicon glyphicon-user"></i>
<span>Admin<i class="caret"></i></span>
</a>
<ul class="dropdown-menu">
<li class="user-header bg-light-blue">
<img src="img/avatar3.png" class="img-circle" alt="User Image" />
<p>Welcome Admin</p>
</li>
<li class="user-footer">
<div class="pull-left">
<a href="#" class="btn btn-default btn-flat">Change Password</a>
</div>
<div class="pull-right">
<a href="index.html" class="btn btn-default btn-flat"><i class="glyphicon glyphicon-log-out"></i>Log out</a>
</div>
</li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
<div class="wrapper row-offcanvas row-offcanvas-left">
<aside class="left-side sidebar-offcanvas">
<section class="sidebar">
<div class="user-panel">
<div class="pull-left image">
<img src="<?php echo Yii::app()->theme->baseUrl;?>/img/avatar3.png" class="img-circle" alt="User Image" />
</div>
<div class="pull-left info">
<p>Hello, Admin</p>
</div>
</div>
<form action="#" method="post" class="sidebar-form">
<div class="input-group">
<input type="text" name="q" class="form-control" placeholder="Search..." />
<span class="input-group-btn">
<button type='submit' name='search' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button>
</span>
</div>
</form>
<ul class="sidebar-menu">
<li class="active">
<a href="<?php echo Yii::app()->theme->baseUrl;?>/home.html">
<i class="glyphicon glyphicon-home"></i><span>Home</span>
</a>
</li>
<li class="treeview">
<a href="#"><i class="glyphicon glyphicon-import"></i><span>Inquiry</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/inquiry.php"><i class="glyphicon glyphicon-list"></i>List Inquiry</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/add-inquiry.php"><i class="glyphicon glyphicon-plus-sign"></i>Add Inquiry</a></li>
</ul>
</li>
<li class="treeview">
<a href="#"><i class="glyphicon glyphicon-import"></i><span>Offer Letter</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/invoices.php"><i class="glyphicon glyphicon-list"></i>List Offer Letter</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/generate-invoice.php"><i class="fglyphicon glyphicon-plus-sign"></i>Generate Offer Letter</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/add-payment.php"><i class="glyphicon glyphicon-plus-sign"></i>Add Payment</a></li>
</ul>
</li>
<li class="treeview">
<a href="#"><i class="glyphicon glyphicon-import"></i><span>Inspection</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/inspection-schedule.php"><i class="glyphicon glyphicon-list"></i>Inspection Schedule</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/add-inspection-reports.php"><i class="glyphicon glyphicon-plus-sign"></i>Add Inspection Reports</a></li>
<li class="divider"></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/sanctions.php">Non-confirmative</a></li>
</ul>
</li>
<li class="treeview">
<a href="#"><i class="glyphicon glyphicon-import"></i><span>Operator Management</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/operators.php"><i class="glyphicon glyphicon-list"></i> Operators</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/operators.php"><i class="glyphicon glyphicon-list"></i> Operators</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/add-operators.php"><i class="glyphicon glyphicon-plus-sign"></i> Add Operator</a></li>
<li class="divider"></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/operator-inspections.php">Operator Inspections</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/add-operator-inspections.php">Add Operator Inspections</a></li>
<li class="divider"></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/sanctions.php">Non-confirmative</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/add-sanctions.php">Add Sanctions</a></li>
<li class="divider"></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/harvest.php">Harvest/Yield</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/add-harvest.php">Add Harvest/Yield</a></li>
<li class="divider"></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/wild-collection.php">Wild Collection</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/add-wild-collection.php">Add Wild Collection</a></li>
<li class="divider"></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/animal-husbandry.php">Animal Husbandry</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/add-animal-husbandry.php">Add Animal Husbandry</a></li>
<li class="divider"></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/processing.php">Processor</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/add-processor.php">Add Processor</a></li>
<li class="divider"></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/trading.php">Trading</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/add-trading-product.php">Add Trading Product</a></li>
<li class="divider"></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/farmers.php">Farmers</a></li>
<li><a href="<?php echo Yii::app()->theme->baseUrl;?>/add-farmers.php">Add Farmers</a></li>
</ul>
</li>
<li>
<a href="<?php echo Yii::app()->theme->baseUrl;?>/reports.php"><i class="glyphicon glyphicon-stats"></i> Reports</a>
</li>
<li>
<a href="#"><i class="glyphicon glyphicon-info-sign"></i> Help</a>
</li>
<li>
<a href="#"><i class="glyphicon glyphicon-user"></i> User Name</a>
</li>
</ul>
</section>
</aside>
<aside class="right-side">
<section class="content-header">
<h1>Home
<small>This page will be a dashboard and contain links to all the section of the portal</small>
</h1>
</section>
<section class="content">
<div class="row">
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-aqua">
<div class="inner">
<h4><i class="glyphicon glyphicon-plus-sign"></i> Add Inquiry</h4>
</div>
<a href="<?php echo Yii::app()->theme->baseUrl;?>/add-inquiry.php" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-green">
<div class="inner">
<h4><i class="glyphicon glyphicon-plus-sign"></i> Generate Performa Invoice</h4>
</div>
<a href="<?php echo Yii::app()->theme->baseUrl;?>/generate-invoice.php" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-yellow">
<div class="inner">
<h4><i class="glyphicon glyphicon-plus-sign"></i> Add Payment</h4>
</div>
<a href="<?php echo Yii::app()->theme->baseUrl;?>/add-payment.php" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-red">
<div class="inner">
<h4><i class="glyphicon glyphicon-list"></i> Schedule Inspection</h4>
</div>
<a href="<?php echo Yii::app()->theme->baseUrl;?>/inspection-schedule.php" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-red">
<div class="inner">
<h4><i class="glyphicon glyphicon-plus-sign"></i> Add Operator</h4>
</div>
<a href="<?php echo Yii::app()->theme->baseUrl;?>/add-operators.php" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-yellow">
<div class="inner">
<h4> Add Operator Inspections</h4>
</div>
<a href="<?php echo Yii::app()->theme->baseUrl;?>/add-operator-inspections.php" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-green">
<div class="inner">
<h4> Add Sanctions</h4>
</div>
<a href="<?php echo Yii::app()->theme->baseUrl;?>/add-sanctions.php" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-aqua">
<div class="inner">
<h4> Harvest/Yield</h4>
</div>
<a href="<?php echo Yii::app()->theme->baseUrl;?>/add-harvest.php" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-green">
<div class="inner">
<h4> Add Farmers</h4>
</div>
<a href="<?php echo Yii::app()->theme->baseUrl;?>/add-farmers.php" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<div class="small-box bg-aqua">
<div class="inner">
<h4><i class="glyphicon glyphicon-stats"></i> Reports</h4>
</div>
<a href="<?php echo Yii::app()->theme->baseUrl;?>/reports.php" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
</div>
</section>
</aside>
</div>

Now, I have created 2 files namely /ksoca_reports/themes/admin_theme/views/site/index.php and /ksoca_reports/themes/admin_theme/views/layouts/main.php. where should i put these to pages? i mean which page to put in which directory?
Please help me since i'm new to yii.
Thank you in advance.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users