I am developing a website where candidate entry has to be done and record search.
I have created a single Blade view file. In which there are different section which are called based on the if condition.
My Display.blade.php view is as below
<center>
#if($ID>0)
<table border="0" width="100%">
<tr>
<td>#include('Header')</td>
</tr>
<tr>
<td style="font-family:arial;font-size:30px;text-align:center;">Edit Registration</td>
</tr>
</table>
#endif
<!--First Call-->
#if($ID < 0)
<table border="0" width="100%">
<tr>
<td>#include('Header')</td>
</tr>
<tr>
<td style="font-family:arial;font-size:30px;text-align:center;">New Registration1</td>
</tr>
</table>
<form action="/Register" method="post" target="_self">
<input type = "hidden" name = "_token" value = "<?php echo csrf_token() ?>">
<table border="1" width="70%" cellpadding="3" style="border-collapse: collapse" bordercolor="#eeeeee">
<tr>
<td>First Name</br><input type="text" name="fname" /></td>
<td>Middle Name</br><input type="text" name="mname" /></td>
<td>Last Name</br><input type="text" name="lname" /></td>
<td>Contact No</br><input type="text" name="contactno" /></td>
</tr>
<tr>
<td colspan="4" align="center"><input type="submit" value="Submit"></td>
</tr>
</table>
</form>
#endif
</center>
Header.blade.php is as below.
<style>
.container
{
background-image: url("header.jpg");
background-repeat: repeat-all;
left:0;
top:0;
width:100%;
height:80px;
}
</style>
<div class="container">
<div class="Cname">Cube Placement</div>
<div class="rTable">
<div class="rTableRow">
<div class="rTableHead">
<strong>
<a href='{!!url('/Register'); !!}'>Register</a>
</strong></div>
<div class="rTableHead"><strong>Report</strong></div>
</div>
</div>
</div>
the code execute fine. When Edit Registration section is executed CSS is missing from the page but when New Registration section is called CSS works fine.
except that everything is working correctly.
What is wrong in my code.
To make your css accessible on every page, place the css file in a folder in the public folder and use this code in the link tag where you call the css file, preferably in the file you load on every page.
{{ URL::to('/') }}/path/style.css
Here you say to the browser go to yourdomain.com/path/style.css
Hope it works for you
I'm trying to create a simple form to show a basic table and a delete query...
I can get the delete query working but when I use an include it does not work, if i run the 'display.php' file alone in browser it runs perfectly and shows the database...
Can anyone advise what would be best way incorporate the display.php file in this html file? Or explain the issue?
<!DOCTYPE html>
<div id="content">
<?php include('display.php')?>
<div id="sidebar"></div>
<div id="footer">
<h5></h5>
</div>
<table>
<tr>
<td>
<form action="delete.php" method="post"></form>
<table border="0" cellpadding="3" cellspacing="1" style="background-color: #536977" width="100%">
<tr>
<td width="150">Enter Username to be deleted</td>
<td width="6">:</td>
<td width="294"><input name="delusername" type="text"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" value="submit"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>
<?php require_once('display.php'); ?>
Presuming they are in the same folder.
I understand that the question is little bit vague. Still I am tempted to ask this. I will give one working example and would like to know, how I can use this in my project. There is a site called http://erail.in .In this, if I want to get the details of a train or PNR, just enter in the form and submit. This (I assume) opens the train or PNR search page of Indian Railways (probably in the background) and get details pertaining to the value given by me and display the result in the page in which I am.
Similar way I have a form in my page which has one input box for entering TLD No.
<html>
<head>
<title>Untitled Document</title>
<link href="/DatePicker.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.5.1.js"></script>
</head>
<body>
<form>
TLD No.<input type="text" id="tip"/>
<input type="submit" id="submit" value="Get" />
</form>
</body>
</html>
Upon submitting this form , I need a jQuery script which opens another search page in another server and submit the form in that page get the result from that page to my script. The search page in that server is like this:
<html>
<head>
<title>INDIVIDUAL ALL REPORT</title>
<base target="_self">
</head>
<body >
<form method="POST" name="form1" action="../dbms/allindvres.asp" target="I1">
<table border="0" cellpadding="0" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#669999" width="100%" id="AutoNumber1" >
<tr>
<th width="100%" colspan="4" style="BACKGROUND-COLOR: #cc6600; COLOR: #ffffff; FONT-WEIGHT: bold; TEXT-TRANSFORM: uppercase">individual data in one click</th>
</tr>
<tr>
<td width="33%" height="22" align="middle" ><font size=4>TLD No <input name="TLDNO" size="10"></td>
<td width="33%" height="22" align="middle" ><font size=4>CC No <input name="CCNO" size="10"></td>
<td width="33%" height="22" align="middle"><font size=4>or Name <input name="name" size="30"></td>
<td width="33%" height="22" align="middle">
<p align="center"><input type="submit" value="Get Life Dose" name="B1"></p>
</td>
</tr>
</table>
</form>
<iframe name="I1" width="100%" height="500" src="../DBMS/allindvres.asp" marginwidth="10" marginheight="5">
Your browser does not support inline frames or is currently configured not to display inline frames.</iframe></p></p>
</body>
</html>
Once the form is submitted, the result is displayed in the iframe above. The resulting html will look like this
<html>
<head>
<body>
<h3 align = 'center'><font color="red">
OTHER STATION
</h3>
<table border="2" align = 'center' cellpadding="0" style="border-collapse: collapse" width="80%" id="AutoNumber2">
<tr>
<TD WIDTH = 85% align = 'left' colspan='3'>
<table border="0" align = 'center' cellpadding="0" width =100%>
<tr>
<td>CC NO:</td>
<td>xxx</td>
<Td>SECTION: </td>
<td>xxx</td>
</tr>
<tr>
<td>NAME: </td>
<td>XXXX </td>
<Td>CATEGORY: </td>
<td>XX</td>
</tr>
<tr>
<td>FATHER'S NAME:</td>
<td>XXXX</td>
<Td>EMP NO: </td>
<td>XXXXX</td>
</tr>
<tr>
<td>BIRTH PLACE </td>
<td>XXXXX</td>
<td>CC NO:</td>
<td>XXXX</td>
</tr>
<tr>
<td>STATE</td>
<td>XXXXX</td>
<td>DATE OF BIRTH</td>
<td>3thMay1968</td>
</tr>
<tr>
<td>QUALIFICATION: </td>
<td>XXXX</td>
<td>DESIGNATION: </td>
<td>XXXX</td>
</tr>
</table>
</body>
</html>
I want to get values in second of second from the above table and display it in my page. How can I accomplish this?
If I am using the action="http://anotherserver/dbms/allindvres.asp" in the form above, After submitting I can get the result in an I frame in my page. But I do not want to use the default form submit method which refreshes the page. That is why I use jQuery. Any work around?
i'm having troubles getting this code to work.
I wanna try and get the info from the database( which works) and put it inside some buttons, and then, when clicking each button i wanna make another 2 divs visible from the same table.
The problem is that only the first button has the fade animation but when clicking the next ones nothing happens. I don't really know how to make each and every one of the buttons have the fade thing effect.
Please help !
$outputList .= '
<div align="center">
<table width="750" border="0">
<tr>
<td><table width="300" border="0">
< tr>
<td width="300" valign="top" id="parent" heith="25px">' . $titlu . '
</tr>
</table>
</td>
<td><table width="750" border="0">
<tr class="dar" width="300" height="auto" id="descript" border="0">
<td>' . $descriere. '</td>
</tr>
<tr>
<td class="dac" width="750" height="700" id="video">Video<img src="images.png" width="430" height="157" /></td>
</tr>
</table>
</td>
</tr>
</table>
</div>';
}
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$(".button").click(function () {
if ($(this).next().is(":hidden")) {
$(this).next().slideDown("fast");
} else {
$(this).next().hide();
}
});
});
</script>
<div>
<?php echo "$outputList"; ?>
</div>
I have this shopping cart page, wherein, it displays the products + price and their quantities
now my problem is, I dunno how to make the total number of items and price updated, once I input a different number of quantity and hit update button
here's my function that "lists" the products based from the $_SESSION data
public function getCartListings(){
if (is_array($_SESSION['cart'])){
foreach($_SESSION['cart'] as $id => $qty){
$query = "SELECT * FROM gg_t_wsproducts WHERE ProductID = $id";
$result = mysql_query($query);
if (!$result){
echo "Couldn't execute query: ".mysql_error();
exit;
}
$product = $this->getProduct($id);
echo '<div class="cart-content">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td width="20%" align="center" style="vertical-align:top !important;">
<img src="images/shopping-cart/thumb-image.png" />
</td>
<td width="80%" style="vertical-align:top !important;">
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-bottom:2px solid #c6c6c6; padding-bottom:10px">
<tbody>
<tr>
<td width="60%"><b style="font-size:18px">'.$product["ProductName"].'</b></td>
<td width="20%">Qty <input id="proditem" name="'.$id.'" type="text" style="width:20px; margin:0 0 0 4px;" value="'.$qty.'"></td>
<td width="20%"><span style="font-size:24px; font-weight:bold;">$'.number_format($product['ProductOverridePrice'],2).'</span></td>
</tr>
</tbody>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td width="50%" valign="bottom" align="left"><br>
<span style="font-size:18px; font-weight:bold;">$'.number_format($product['ProductOverridePrice'],2).'</span><br>
<img src="images/shopping-cart/star.png" /> <img src="images/shopping-cart/star.png" /> <img src="images/shopping-cart/star.png" /> <img src="images/shopping-cart/star.png" /> <img src="images/shopping-cart/star.png" /><br>
<span style="font-size:12px; color:#828282;">14 reviews</span>
</td>
<td width="50%" valign="bottom" align="right">
<a class="removefromcart" name="'.$id.'" id="'.$qty.'" href="#"><img src="images/shopping-cart/remove-item-btn.png" border="0" /></a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>';
}//end foreach
}
}
As you can see above, the items are coming from the foreach loop
here's the front-end code that display the actual items
<div id="catalog-wrapper">
<form action="#" method="POST" id="updatecart">
<h1 class="cart-header">ITEMS IN YOUR CART <span style="float:right"><input type="image" name="updatecart" src="images/shopping-cart/update-cart-btn.png" border="0" /> <img style="float:right;" src="images/shopping-cart/continue-shopping-btn.png" border="0" /></span></h1>
<?php $myCart->getCartListings(); ?>
</form>
</div>
and now, here's the "useless" jquery code i have
$('input[name="updatecart"]').click(function(){
var pid = $('input#proditem').attr('id');
var qty2 = $('input[type="text"]').each(function(idx,elem){
});
$.ajax({
type: "POST",
url: "classes/ajax.cartupdate.php",
data: "pid="+pid+"&qty2="+qty2,
success: function(data){
alert(data);
location.reload();
}
});
return false;
});
the ajax PHP code should have been something like this...but am still having a problem with those codes above..not really sure what to do
if ($qty2){
$cart->updateCart($qty2);
$_SESSION['total_items'] = $cart->totalItems($_SESSION['cart']);
$_SESSION['total_price'] = $cart->totalPrice($_SESSION['cart']);
echo "cartUpdated!";
}
Why you are getting multiple variables? Just get one array and explode it on server side with PHP. I mean, create a javascript array and include every input value in it and then send it to PHP. But in your code there will be two array, no problem. It would like this:
pid="1,2,3,4,5,6,7"+&qtty="0,1,1,0,1,1,0"
Get this values with PHP and explode them to "," and do whatever you want with for loop. By the way, if you will reload the page after sending, then why you are using the ajax method?