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
Related
I am trying to add an option in the backend of an administration panel where admins can change the user type. Called: Change User Type
Before these were the options available: Add Notes about Driver and Change Email :
I modified the php and added the front end selector to Change user type in the admin panel:
But the problem is that it keeps pulling a box to enter data. I want a list with all user types to be listed in a drop down so I can select a user type and change and not add notes to it.
In the database I only have three types of users "user_group". They are listed under Ids 1, 2, and 3.
MY QUESTION IS:
How can I make a drop down list appear, once I select Change User Type after already having selected the user under the Select Driver options in the previous drop down?
My user type ids are listed under user_group
Below is the current code on the file, which is not very much:
function fn_ACTION_METHOD(sMethod){
if(sMethod=='notes'){
document.getElementById('comment_box').style.display='block';
document.getElementById('email_box').style.display='none';
document.getElementById('btnSUBMIT').value='ADD NOTES';
}else if(sMethod=='email'){
document.getElementById('comment_box').style.display='none';
document.getElementById('email_box').style.display='block';
document.getElementById('btnSUBMIT').value='CHANGE EMAIL';
}else if(sMethod=='user_group'){
document.getElementById('comment_box').style.display='none';
document.getElementById('email_box').style.display='block';
document.getElementById('btnSUBMIT').value='ChangeType';
}
}
function fn_LOAD_EMAIL(iDriverID){
$.get("ajax_data.php", {action: 'load-email', did: iDriverID}, function(data){
if (data=="ERROR"){
$('#Message').html("Error!!! in loading driver email");
}else{
$('#txtemail').val(data);
}
}, 'html');
}
</script>
</head>
<body style="margin: 0px;">
<div align="center">
<table border="0" cellspacing="0" cellpadding="0">
<!--start header -->
<? include('inc_header.php'); ?>
<!-- start side nav -->
<!-- actual page -->
<td>
<table border="0" cellspacing="0" cellpadding="0" width="980">
<tr valign="top" align="left">
<td width="15" height="16"><img src="../assets/images/autogen/clearpixel.gif" width="15" height="1" border="0" alt=""></td>
<td width="1"><img src="../assets/images/autogen/clearpixel.gif" width="1" height="1" border="0" alt=""></td>
<td width="949"><img src="../assets/images/autogen/clearpixel.gif" width="683" height="1" border="0" alt=""></td>
<td width="15"><img src="../assets/images/autogen/clearpixel.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr valign="top" align="left">
<td height="40"></td>
<td colspan="2" width="949">
<table border="0" cellspacing="0" cellpadding="0" width="949" style="background-image: url('../assets/images/banner.png'); height: 40px;">
<tr align="left" valign="top">
<td width="100%">
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr>
<td class="TextObject" align="center">
<h1 style="margin-bottom: 0px;">DRIVER NOTES & EMAIL CHANGE</h1>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top" align="left"><td colspan="4"> </td></tr>
<tr valign="top" align="left"><td colspan="4"> </td></tr>
<tr valign="top" align="left">
<td colspan="2"></td>
<td width="1050" class="TextObject" align="center">
<form name="frm1" action="driver_notes_email.php" method="post">
<input type="hidden" name="action" value="add_action" />
<table cellpadding="0" cellspacing="5" border="0" width="800" align="center" class="box">
<tr><td colspan="2" id="Message" width="100%"><?=$sMessage?></td></tr>
<tr>
<td class="label" width="200">Driver:</td>
<td width="800"><? fn_DISPLAY_USERS('drpdriver', 0, "200", "1", "--Select Driver--", "CONCAT(l_name, ' ', f_name) AS user_name", "l_name", $iGROUP_DRIVER.",".$iGROUP_COORDINATOR_STAFF, "fn_LOAD_EMAIL(this.value);");?></td>
</tr>
<tr>
<td class="label">Action:</td>
<td>
<div class="left"><input type="radio" id="opttype" name="optaction" value="ChangeType" onClick="fn_ACTION_METHOD('notes');"/></div>
<span class="label left">Change User Type</span>
<div class="left"><input type="radio" id="optnotes" name="optaction" value="Notes" onClick="fn_ACTION_METHOD('notes');"/></div>
<span class="label left">Add Notes about Driver</span>
<input type="radio" id="optreading" name="optaction" value="Change Email" onClick="fn_ACTION_METHOD('email');"/>
<span class="label">Change Email</span>
</td>
</tr>
<tr>
<td colspan="2">
<div id="email_box" style="display:none;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="label" width="200">Email:</td>
<td width="400"><input type="text" id="txtemail" name="txtemail" value="" maxlength="150" style="width:250px;" /></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div id="comment_box" style="display:none; width:100%;">
<table cellpadding="0" cellspacing="5" border="0" width="100%">
<tr>
<td class="label" valign="top" width="200">Notes:</td>
<td width="400"><textarea name="txtcomments" id="txtcomments" cols="50" rows="10" style="width:250px;" ></textarea></td>
</tr>
</table>
</div>
</td>
</tr>
<tr><td colspan="2"> </td></tr>
<tr><td></td><td><input type="button" name="btnSUBMIT" id="btnSUBMIT" value="ACTION" class="Button" onClick="valid_action(this.form);" style="width:150px;" /></td></tr>
</table>
</form>
</td>
<td></td>
</tr>
</table>
</td>
<!-- end actual page -->
<!-- footer -->
<? include('inc_footer.php'); ?>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>
Look in your html code where the div id equals email_box. This box is already on the page but is hidden. In your javascript you added for the 'change user type' you correctly changed the action button but you are still just showing the email_box div by calling style display = block
You need to add a new div which is hidden by default with a select box in it, and only show it when the radio button is clicked. You will also need to add your php code in to actually update the user when the form is submitted.
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 have a basic form that submits the form data to the same page and do a simple search in a MySQL db. The php for this in before the <html> tag
<body>
<div data-role="page">
<div role="main" class="ui-content">
enter code here
<table style="width:750px;">
<form enctype="multipart/form-data" action="player_documents_m.php" method="get" data-ajax="false">
<tr style="height:35px;">
<td style="width:250px; vertical-align:top; text-align:left;">
<label for="name">Player Name: </label>
</td>
<td style="text-align:left; vertical-align:middle; text-align:center;">
<input type="text" name="name" id="name" class="inputs" size="45" value="<?php echo $my_name; ?>" maxlength="255"/>
</td>
</tr>
<tr style="height:35px;">
<td style="text-align:left; vertical-align:bottom; text-align:right;" colspan="2">
<input type="submit" name="search" id="search" value="Search Player" />
</td>
</tr>
</form>
</table>
The above works in JqueryMobile
Then the results are added dynamically with html content but this does not work in JqueryMobile but taking out all JQueryMobile related stuff and leave a normal php page everything works.
Below the table tag above I add my php to add the founded search results.
<?php
for($j = 0; $j < $i; $j++)
{
$photo = "images/" . $db_new . "/players/" . $player[$j]["player_id"] . ".jpeg";
echo "<br />";
?>
<!-- Search Results -->
<div class="singleResult" onclick="javascript: window.location.replace('load_documents.php?identification=<?php echo $player[$j]["player_id"]; ?>');">
<table border="1" style="width:100%; border: solid thin; padding:0; border-spacing:0;">
<tr>
<!-- Image 1st Column -->
<td rowspan="2" colspan="1" style="width:10%; vertical-align:top; text-align:left;">
<img src="<?php echo $photo; ?>" style="width:150px; height:180px;" />
</td>
<td class="labels">Name:
<p class="results"><?php echo $player[$j]["player_name"]; ?></p>
</td>
</tr>
</table>
</div>
<!-- End Of Search Results -->
<?php
}
?>
</div>
</div>
</body>
Now the above only works normally and not in JqueryMobile. can some please explain to me what I am doing wrong / need to add, or anything helpful please.
Thanks
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?
below is the given div having id "panel" and links in the same page but outside this div, when I click on the link this div should be open. there are several links so jquery does not work and my button is created dynamically through php while loop hence i cannot put unique id in my hyperlink
<div id="panel">
<form name="userloginform" action="xxx.php" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="tb">
<tr>
<td align="left" valign="middle" height="80">User Name</td>
<td align="left" valign="middle">: </td>
<td align="left" valign="middle"><input name="user" type="text" class="log"/></td>
</tr>
<tr>
<td align="left" valign="middle">Password</td>
<td align="left" valign="middle">: </td>
<td align="left" valign="middle"><input name="pass" type="password" class="log"/></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3"><input name="submit1" type="submit" value="Login" class="login_btn"/></td>
</tr>
</table>
</form>
</div>
and my link is
<a href="#" id="flip" >Launch Now</a>
<a href="#" id="" >Launch Now</a>
If I am not clear please reply which part is not clear so that I can edit and provide useful information clearly
ok here is where link is coming from, a CMS is used here.
<?php
$sql=mysql_query("SELECT * FROM heading ORDER BY id DESC");
while($r=mysql_fetch_array($sql))
{
$ii=$r['id'];
?>
<h3><?php echo $r['heading'];?></h3>
<div>
<div class="content">
<div class="main_table_wrapper">
<table width="1030" border="0" cellspacing="0" cellpadding="0" align="left">
<?php
$sql2=mysql_query("SELECT * FROM inner_table WHERE head='$ii'") ;
while($rows=mysql_fetch_array($sql2))
{
$abc=str_replace($rows['url'],'XXXXXXXXXXXXXXX',$rows['url']);
?>
<tr>
<th align="left" valign="middle" width="350"><?php echo $rows['inner_names'];?></th>
<th align="left" valign="middle" width="250"><?php echo $abc;?></th>
<th align="left" valign="middle" width="200"><?php echo $rows['author'];?></th>
<th align="center" valign="middle" width="100"><?php echo $rows['doe'];?></th>
<th align="right" valign="middle" width="130"><span class="lunch">Launch Now</span></th>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
<?php } ?>
</div>
You can't have multiple elements with the same id.
Since you didn't show any JS code so far, the only advice I can give is to use a class as the identifier for the action link.
From the look of your markup you could also use something along
$('span.lunch').on('click', 'a', function(e) { //do stuff } );