clicking menu error does not show the page - codeigniter

What is the difference between:
http://localhost/gsa/profile/history --> (offline)
and
http://www.gsa-constructionspecialist.com/profile/history (online)
Offline shows:
Not Found
The requested URL /gsa/profile/history was not found on this server.
After clicking this menu:
views/0hearder.php
<div id="menu">
<h3 class="listmenu" data="1" data-title="home">Home</h3>
<h3 class="listmenu" data="2" data-title="profile">Home</h3>
<div class="submenu2" style="display:none">
<?php
$profile = $this->post_model->post(1);
if ($profile){
foreach ($profile as $pro){
?>
<h3 class="submenu" style="<?php echo ($this->uri->segment(2)==$pro->post_alias)?'font-weight:bold':''; ?>"><?php echo $pro->post_title; ?></h3>
<?php } } ?>
</div>

Related

codeigniter form_error() not showing error beside form-control

I am trying to show validation errors beside the form-control but form_error() is not working.
codeigniter form_error() not showing error beside form-control
The validation_errors() is working but form_error() not working beside the input control
Admin Controller
<?php
class Admin extends CI_Controller
{
public function index()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('uname','Username','required|alpha');
$this->form_validation->set_rules('pass','Password','required|max_length[12]');
$this->form_validation->set_error_delimiters("<div class='text-danger'>","</div>");
if($this->form_validation->run())
{
echo "Validation successful";
}
else
{
//echo validation_errors();
$this->load->view('Users/articleList');
}
}
}
?>
The view is
application/views/Users
<?php include('header.php'); ?>
<div class="container" style="margin-top:20px";>
<h1> Admin Form </h1>
<?php echo form_open('admin/index');?>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label for="Username">Username</label>
<?php echo form_input(['class'=>'form-control', 'placeholder'=>'Enter Username','name'=>'uname']);?>
</div>
</div>
<div class="col-lg-6">
<?php form_error('uname');?>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<label for="Password">Password</label>
<?php echo form_password(['class'=>'form-control','type'=>'password',
'placeholder'=>'Enter Password', 'name'=>'pass'
]);?>
</div>
<div class="col-lg-6">
<?php form_error('pass');?>
</div>
</div>
</div>
<?php echo form_submit(['type'=>'submit', 'class'=>'btn btn-default','value'=>'Submit']); ?>
<?php echo form_reset(['type'=>'submit', 'class'=>'btn btn-default','value'=>'Reset']); ?>
</div>
<?php echo validation_errors();?>
<?php include('footer.php'); ?>
You need to echo the form_error so...
<?php form_error('pass');?>
becomes
<?php echo form_error('pass');?>
or
<?= form_error('pass');?>

how to add show data on modal for individual id?

I want when user click on "more detail href". they should get this detail on modal the box.
<ul class="list-tickets">
<?php foreach ($searchFlights as $searchFlight) {
//One Way Logic
$stopInfo_O = "";
$stopCount_O = 0;
$AirlineLogo_O = $this->search_model->getAirlinelogo($searchFlight->airline_idO);
$finalDepartdate_O = $searchFlight->departure_dateO;
$DepartAirpot_O = $this->search_model->getAirportCode($searchFlight->depart_airportidO);
$totalFlightTime_O = $searchFlight->total_flighttimeO;
$finalArrivaldate_O = $searchFlight->arrival_dateO;
$totalBaggage_O = $searchFlight->baggageO;
$stopOvertime1 = $searchFlight->stopover1_staydurationO;
$className0 = $searchFlight->classNameO;
$ArrivalAirpot_O = $this->search_model->getAirportCode($searchFlight->arrival_airportidO);
$flightPrice = $searchFlight->flightPrice;
if($searchFlight->operatedby_airlineidO == "0") {
$operatedAirlinename = "";
} else {
$operatedAirlinename = $this->search_model->getAirlinename($searchFlight->operatedby_airlineidO);
}
//Stops Handling Oneway
if(empty($searchFlight->stopover1_airportidO) && empty($searchFlight->stopover2_airportidO)){ $stopInfo_O = "Direct"; }
if($searchFlight->stopover1_airportidO != 0){ $stopCount_O++; }
if($searchFlight->stopover2_airportidO != 0){ $stopCount_O++; }
if($stopCount_O>0){
$stopInfo_O .= $stopCount_O." Stop ";
//Stop oneway 1
$stopInfo_O .= $this->search_model->getAirportCode($searchFlight->stopover1_airportidO);
if($stopCount_O == 2) {
//Stop One Way 2
$stopInfo_O .= ", ".$this->search_model->getAirportCode($searchFlight->stopover2_airportidO);
}
}
?>
<li class="list-item">
<div class="list-item-inner">
<div class="list-item-main">
<!-- Oneway Section -->
<div class="list-item-top">
<div class="list-item-logo">
<img src="<?= base_url(); ?>uploads/<?php echo $AirlineLogo_O; ?>" alt="">
</div>
<div class="list-item-content">
<div class="list-item-content-left">
<!-- Final Departure Dates-->
<div class="text-bold text-base">
<?php echo $finalDepartdate_O; ?>
</div>
<!-- Departure Airport -->
<span class="small reveal-block">
<?php echo $DepartAirpot_O; ?>
</span>
</div>
<div class="list-item-content-line-wrapper small">
<!-- Total Flight Time -->
<div class="list-item-content-line-top">
<?php echo $totalFlightTime_O; ?>
</div>
<div class="list-item-content-line"></div>
<!-- Stops info -->
<div class="list-item-content-line-bottom text-primary">
<p title="<?php echo $stopOvertime1; ?>"><?php echo $stopInfo_O; ?> </p>
</div>
</div>
<div class="list-item-content-right">
<!-- Final Arrival date -->
<div class="text-bold text-base">
<?php echo $finalArrivaldate_O; ?>
</div>
<!-- Arrival Airport -->
<span class="small reveal-block">
<?php echo $ArrivalAirpot_O; ?>
</span>
</div>
</div>
</div>
</div>
<div class="list-item-footer ticket-holder-dt">
<h5 class="text-bold list-item-price"><?php echo COMMON_CurrencySymbol." ".$flightPrice;?></h5>
<span class="ticket-include"></span>
<span class="ticket-type">One way</span>
<a class="btn btn-info btn-xs btn-no-shadow" href="<?= base_url(); ?>searchflights/bookFlight?id=<?php echo $searchFlight->id; ?>">
Book Now
</a>
<br>
<a href="">
More detail <!-- I want when user click on it. they should get this detail on modal the box -->
</a>
<br>
<?php echo $className0; ?> Class
</div>
</div>
<div class="small text-gray-light list-item-subtitle">Operated by <?php echo $operatedAirlinename; ?></div>
<div class="tripbaggage">Baggage: <?php echo $totalBaggage_O; ?></div>
<?php } ?>
You can achieve this by implementing separate modal for each id inside for loop or
by implementing Ajax request to show the detail information of the corresponding id.

Magento 1.9 order comment ADD do backend info

I am trying to add a box for customers to place a comment on their order.
I've added it to my
/checkout/cart/cart.phtml
You can see I added it here
<div class="cart-collaterals">
<div class="row">
<th><?php echo $this->__('Comments') ?></th>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-6">
<?php echo "Any special requirements regarding this order?"; ?>
<!-- COmments box -->
<td class="a-center">
<textarea name="cart[<?php echo $_item->getId() ?>][comments]" rows="3" cols="20"><?php echo $_item->getItemcomment() ?></textarea>
</td>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-4">
<?php echo $this->getChildHtml('coupon') ?>
</div>
<div class="col-xs-12 col-sm-12 col-md-4">
<?php echo $this->getChildHtml('checkout.cart.extra') ?>
<?php if (!$this->getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?>
</div>
<div class="col-xs-12 col-sm-12 col-md-4">
<div class="cart-totals">
<span id='ajax_loadertotals' style='display:none'><!--<img src='<?php //echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/>--><div class="loaderTotals">Loading...</div></span>
<div class="totals">
<?php echo $this->getChildHtml('totals'); ?>
<?php if(!$this->hasError()): ?>
<ul class="checkout-types">
<?php foreach ($this->getMethods('methods') as $method): ?>
<?php if ($methodHtml = $this->getMethodHtml($method)): ?>
<li><?php echo $methodHtml; ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
</div>
<div id="shipping-info-link">
Delivery & Shipping Information
</div>
</div>
</div>
<?php
echo $this->getLayout()->createBlock('giftcard/checkout_cart_giftcard')->setTemplate('mt/giftcard/checkout/cart/giftcard.phtml')->toHtml();
?>
<?php echo $this->getChildHtml('crosssell') ?>
</div>
Now my problem comprises here:
How can I make it so I (the sales person) can see it on the backend when the order comes through?
I don't mind changing this to the checkout page if it makes it easier. If you could give me some help with it, I'd really appreciate. I've looked around but didn't find anything useful
Thanks
1)Add custom field/attribute in sales_flat_order table using install script, the sample is given below
$installer = $this;
$installer->startSetup();
$installer->getConnection()
->addColumn(
$installer->getTable('sales/order'), 'cutom_comment', 'VARCHAR(150) NOT NULL'
);
$installer->endSetup();
2) Add the field into the checkout page
3) You can use the event "checkout_type_onepage_save_order"
4) you can get the value using Mage::app()->getRequest()->getPost('custom_comment')
5) get the order details using $order = $observer->getEvent()->getOrder();
6) save the order
$order->setCustomComment($comment);
7) add a custom layout for admin
for that ref
8 ) get order details with $order = $this->getOrder()
9) get value by $customComment = "$order->getCustomComment();"

Drop Down Menu in Magento

I have this code in template to make a static home button. On the home button on hover over I would like to have a blog button underneath.
<?php $_menu = $this->getHtml('level-top') ?>
<?php if($_menu): ?>
<div class="nav-container">
<div class="container_24">
<div class="grid_24">
<div id="menu-icon">Categories</div>
<ul id="nav" class="sf-menu">
<li class="level0 level-top<?php if (Mage::helper('core/url')->getCurrentUrl() === Mage::helper('core/url')->getHomeUrl()) echo ' active'; ?>">
<a class="level-top" href="<?php echo $this->getUrl('')?>">
<span>Home</span>
</a>
</li>
<?php echo $_menu ?>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
<?php endif ?>

Add to cart button not adding product in cart

I have created a new1.phtml file in catalog/product with following content
<?php
//getting new product collection
$product=Mage::getModel("catalog/product")->getCollection();
$filtered_prodduct=$product->addAttributeToSelect("*")
->setOrder("created_at","desc")
->addPriceData();
echo "<ul>
<li>";
$i=0;
$row=3;
foreach($filtered_prodduct as $prod){
$i++;
if($i>$row*3){
break;
}
?>
<div class="prod_box">
<div class="center_prod_box">
<div class="product_title">
<a href="<?php echo $prod->getProductUrl()?>">
<?php echo $prod->getName() ?>
</a>
</div>
<div class="product_img">
<a href="<?php echo $prod->getproductUrl()?>">
<img src="<?php echo $prod->getImageUrl()?>" alt="" border="0" height="100" width="100">
</a>
</div>
<div class="prod_price">
<span class="reduce"><?php echo $prod->getSpecialPrice()?></span>
<span class="price"><?php echo $prod->getPrice()?></span><br/>
</div>
</div>
<div class="prod_details_tab">
<?php if($prod->isSaleable()): ?>
<a href="<?php echo $this->getUrl()?>checkout/cart/add? product=<?php echo $prod->getId(); ?>&qty=1" class="prod_buy">
<?php echo $this->__('Add') ?>
</a>
<?php else: ?>
<p class="availability out-of-stock"><span>
<?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?>
<a href="<?php echo $prod->getProductUrl()?>" class="prod_details">
Details
</a>
</div>
</div>
<?php }
?>
Every thing is ok ,but 'Add' button (means add to cart) is not working .It just opens checkout/cart.
i have added this phtml file in layout xml of home page. what is wrong in the code ?
You can do this my using below code ,which generated add to cart url.
Mage::helper('checkout/cart')->getAddUrl(($prod);
If product type is configurable and group or if product type is simple and it have customoption ,then it did not cart directly without selecting any options
The controller's action validates request therefore you should send formKey
public function addAction()
{
if (!$this->_validateFormKey()) {
$this->_goBack();
return;
}
...
{
Mage::helper('checkout/cart')->getAddUrl(($prod);

Resources