For the vaccine ticket, I created an HTML page. When you download a PDF, the layout changes. How to solve this issue
ticket.php
<div class="container" style=" text-align: left;">
<div class="form-group">
<div class="row mt-4">
<div class="col-md-4">
<span><i class="fa fa-registered" style="font-size:16px;color: #666363;"></i></span>
<span>Reg No</span>
</div>
<div class="col-md-8" style="float: right;">
12546546
</div>
</div>
</div>
HTML output:
PDF output:
Related
I have a problem with WebDriver's XPath that, even though it's right, is returning an error expression.
The expression is:
(*//div[contains(#class, 'myb-SettledBetItem ') or contains(#class, 'myb-OpenBetItem_Collapsed') or contains(#class, 'myb-OpenBetItem ')]//(span[#class='myb-SettledBetParticipant_ParticipantSpan ' or #class='myb-OpenBetParticipant_ParticipantSpan']|div[#class='myb-SettledBetItem_SubHeaderText']))
The html is:
<div class="myb-BetItemsContainer_BetItemsContainer ">
<div class="myb-SettledBetItem ">
<div class="myb-SettledBetItemHeader ">
<div class="myb-SettledBetItemHeader_HeaderTextContainer ">
<div class="myb-SettledBetItemHeader_Title ">
<div class="myb-SettledBetItemHeader_Text ">R$0,50 Simples</div>
</div>
<div class="myb-SettledBetItem_SubHeaderText "></div>
</div>
<div class="myb-SettledBetItem_BetStateContainer ">
<div class="myb-SettledBetItem_BetStateLabel ">Retorno Obtido</div>
<div class="myb-SettledBetItem_BetReturnLabel ">R$1,19</div>
</div>
</div>
<div>
<div>
<div class="myb-SettledBetParticipant-FirstOfType myb-SettledBetParticipant myb-SettledBetParticipant_Won ">
<div class="myb-SettledBetParticipant_Header ">
<div class="myb-SettledBetParticipant_HeaderTitle ">
<div class="myb-SettledBetParticipant_HeaderText "><span class="myb-SettledBetParticipant_ParticipantSpan ">Hollyoak Hector (v Courts Ad Darcey) </span>
<div class="myb-HalfAndHalfPill myb-HalfAndHalfPill_Status-1 ">
<div class="myb-HalfAndHalfPill_TextStatus myb-HalfAndHalfPill_TextStatus-1 ">
<div class="myb-HalfAndHalfPill_TextStatusLHS myb-HalfAndHalfPill_TextStatusLHS-1 "></div>
<div class="myb-HalfAndHalfPill_TextStatusRHS myb-HalfAndHalfPill_TextStatusRHS-1 "></div>
</div>
</div>
</div>
</div>
<div class="myb-SettledBetParticipant_HeaderOdds ">2.37</div>
</div>
<div class="myb-SettledBetParticipant_MarketDescription ">Aposta Comparativa</div>
<div class="myb-SettledBetParticipant_FixtureDescription ">8.27 Central Park EVE (Corrida 8)</div>
</div>
</div>
<div class="myb-SettledBetItemFooter ">
<div class="myb-SettledBetItemFooter_BetInformation ">
<div class="myb-SettledBetItemFooter_StakeInformation ">
<div class="myb-SettledBetItemFooter_StakeLabel ">Aposta</div>
<div class="myb-SettledBetItemFooter_StakeTextWrapper "><span class="myb-SettledBetItemFooter_StakeTextCurrency myb-SettledBetItemFooter_StakeTextCurrency-formatted ">R$</span><span class="myb-SettledBetItemFooter_StakeText ">0,50</span></div>
</div>
<div class="myb-SettledBetItemFooter_ReturnInformation ">
<div class="myb-SettledBetItemFooter_ReturnLabel ">Retorno Total</div>
<div class="myb-SettledBetItemFooter_ReturnTextWrapper "><span class="myb-SettledBetItemFooter_ReturnTextCurrency myb-SettledBetItemFooter_ReturnTextCurrency-formatted ">R$</span><span class="myb-SettledBetItemFooter_ReturnText ">1,19</span></div>
</div>
</div>
</div>
</div>
</div>
<div class="myb-SettledBetItem ">
<div class="myb-SettledBetItemHeader ">
<div class="myb-SettledBetItemHeader_HeaderTextContainer ">
<div class="myb-SettledBetItemHeader_Title ">
<div class="myb-SettledBetItemHeader_Text ">R$0,50 Simples</div>
</div>
<div class="myb-SettledBetItem_SubHeaderText "></div>
</div>
<div class="myb-SettledBetItem_BetStateContainer ">
<div class="myb-SettledBetItem_BetStateLabel ">Retorno Obtido</div>
<div class="myb-SettledBetItem_BetReturnLabel ">R$0,77</div>
</div>
</div>
<div>
<div>
<div class="myb-SettledBetParticipant-FirstOfType myb-SettledBetParticipant myb-SettledBetParticipant_Won ">
<div class="myb-SettledBetParticipant_Header ">
<div class="myb-SettledBetParticipant_HeaderTitle ">
<div class="myb-SettledBetParticipant_HeaderText "><span class="myb-SettledBetParticipant_ParticipantSpan ">Trap 8 </span>
<div class="myb-HalfAndHalfPill myb-HalfAndHalfPill_Status-1 ">
<div class="myb-HalfAndHalfPill_TextStatus myb-HalfAndHalfPill_TextStatus-1 ">
<div class="myb-HalfAndHalfPill_TextStatusLHS myb-HalfAndHalfPill_TextStatusLHS-1 "></div>
<div class="myb-HalfAndHalfPill_TextStatusRHS myb-HalfAndHalfPill_TextStatusRHS-1 "></div>
</div>
</div>
</div>
</div>
<div class="myb-SettledBetParticipant_HeaderOdds ">1.53</div>
</div>
<div class="myb-SettledBetParticipant_MarketDescription ">Vencedor e V/C Ao-Vivo</div>
<div class="myb-SettledBetParticipant_FixtureDescription ">Race 15 Palm Beach</div>
</div>
</div>
<div class="myb-SettledBetItemFooter ">
<div class="myb-SettledBetItemFooter_BetInformation ">
<div class="myb-SettledBetItemFooter_StakeInformation ">
<div class="myb-SettledBetItemFooter_StakeLabel ">Aposta</div>
<div class="myb-SettledBetItemFooter_StakeTextWrapper "><span class="myb-SettledBetItemFooter_StakeTextCurrency myb-SettledBetItemFooter_StakeTextCurrency-formatted ">R$</span><span class="myb-SettledBetItemFooter_StakeText ">0,50</span></div>
</div>
<div class="myb-SettledBetItemFooter_ReturnInformation ">
<div class="myb-SettledBetItemFooter_ReturnLabel ">Retorno Total</div>
<div class="myb-SettledBetItemFooter_ReturnTextWrapper "><span class="myb-SettledBetItemFooter_ReturnTextCurrency myb-SettledBetItemFooter_ReturnTextCurrency-formatted ">R$</span><span class="myb-SettledBetItemFooter_ReturnText ">0,77</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
Expected outcome:
Hollyoak Hector (v Courts Ad Darcey)
Trap 8
And was tested on the site: http://xpather.com/
The error returned is:
Fatal error: Uncaught Facebook\WebDriver\Exception\InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression THIS_EXPRESSION because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string THIS_EXPRESSION is not a valid XPath expression. .... in DIR/vendor/facebook/webdriver/lib/Exception/WebDriverException.php on line 152
What is happening? Why doesn't it work in WebDriver's Xpath and it works on this site?
Is this the best way to handle this data?
Your XPath expression only works in XPath-2.0 or above.
To make it work in XPath-1.0, you have to split what you have tried to do with the brackets:
//div[contains(#class, 'myb-SettledBetItem ') or contains(#class, 'myb-OpenBetItem_Collapsed') or contains(#class, 'myb-OpenBetItem ')]//span[#class='myb-SettledBetParticipant_ParticipantSpan ' or #class='myb-OpenBetParticipant_ParticipantSpan'] | //div[contains(#class, 'myb-SettledBetItem ') or contains(#class, 'myb-OpenBetItem_Collapsed') or contains(#class, 'myb-OpenBetItem ')]/div[#class='myb-SettledBetItem_SubHeaderText']
So duplicate the first part of the expression and apply the union afterwards on both expressions.
i have a problem with css row and columns, when i include php file in html my columns only arrange vertically
this is for my dashboard website, and i have try to find solution but no luck
when i put code like this
<div class="row">
<div class="col-md-4" id="list">
<div class="bg-mattBlackLight my-2 p-4">
<h1>HELLO</h1>
</div>
</div>
<div class="col-md-4" id="list">
<div class="bg-mattBlackLight my-2 p-4">
<h1>HELLO</h1>
</div>
</div>
<div class="col-md-4" id="list">
<div class="bg-mattBlackLight my-2 p-4">
<h1>HELLO</h1>
</div>
</div>
</div>
Works perfectly with column size and placement
(screen shot: https://ibb.co/tqRvBtL)
but when i include php page like this
<div class="row">
<div class="col-md-4" id="list">
<div class="bg-mattBlackLight my-2 p-4">
<?php include 'php/user-list.php';?>
</div>
</div>
<div class="col-md-4" id="list">
<div class="bg-mattBlackLight my-2 p-4">
<h1>HELLO</h1>
</div>
</div>
<div class="col-md-4" id="list">
<div class="bg-mattBlackLight my-2 p-4">
<h1>HELLO</h1>
</div>
</div>
</div>
the columns arrange is vertical
(screen shot: https://ibb.co/Q6qQJDJ)
Dose anybody know what is wrong?
Make sure you have closed all the open tags inside PHP files
i have created a model product on laravel-voyager using dummy section and laravel-voyager and i have created product section and used the bread system but when i tried to put the data to the front end the images text are not showing please help
how to create product section and how to used for front end i have created a put images the text are not showing on the post there are showing and i'm beginner on laravel-voyager
i have tried the product i have type the code correctly and also data is showing on front end but images text price are not showing on the page
<div class="col-xl-8 col-lg-12 row-fluid float-left p-0">
#foreach($products as $product)
<div class="col-lg-4 col-md-6 col-sm-12 pl-0 pr-0 pb-4 float-left">
<div class="products-list__item p-2 lightgrey_borders">
<form method="post" class="pr-2 pl-2" action="/product/{{ $product->id }}">
<button class="float-right add_to_wishlist" type="submit"><i data-id="49872" class="icon-herz wishlist rose-highlight"></i></button>
<div class="products-list__image">
<img alt="" src=Voyager::image{{$product->image}}" width="50px">
</div>
<h4 class="delta products-list__title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"></font></font></h4>
<hr class="rule">
<div class="products-list__footer">
<span class="products-list__price"><small>
<font style="vertical-align: inherit;">
<font style="vertical-align: inherit;">only</font>
</font>
</small>
<font style="vertical-align: inherit;"><font style="vertical-align: inherit;">$ {{$product->price}}</font>
</font>
</span>
</div>
</form>
</div>
</div>
#endforeach
<div class="col-lg-4 col-md-6 col-sm-12 pl-0 pr-0 pb-4 float-left">
</div>
</section>
</section>
images,text and price is not showing
In an html page, I would like to recover the value of an amount and can change the value only in my admin panel.
In the file navbar.blade.php I have 250 which is the amount to edit for the example.
<div class="header-widgets hidden-xs" style="padding:0px;padding-top: 60px;">
<div id="text-3" class="widget widget_text">
<div class="textwidget">
<div class="info-icon">
<img src="/img/time.png">
<span style="font-size: 22px;color: #0d3863;font-weight: bold;"> 250</span>
</div>
</div>
</div>
</div>
I just seek to edit the amount (250) ...
In my Controller named tarrifcontroller I have that.
public function edit(Tariff $tariff)
{
return view('admin.tariffs.edit', compact('tariff'));
}
public function update(Request $request, Tariff $tariff)
{
$tariff->valeur = strip_tags($request->input('amount'));
$tariff->save();
return redirect('/tariffs');
}
In my edit.blade.php I have that
#section('content')
<div class="px-content">
<div class="page-header">
<div class="row">
<div class="col-md-4 text-xs-center text-md-left text-nowrap">
<h1><i class="px-nav-icon ion-android-apps"></i>Tarif {{$tariff->id}} </h1>
</div>
<hr class="page-wide-block visible-xs visible-sm">
<!-- Spacer -->
<div class="m-b-2 visible-xs visible-sm clearfix"></div>
</div>
</div>
<div class="row">
<div class="panel">
<div class="panel-body">
<div class="table-responsive">
<form class="panel-body" action="/tariff/edit/{{$tariff->id}}" method="POST">
#csrf
<fieldset class="form-group">
<label for="form-group-input-1">Amount</label>
<input type="text" name="amount" class="form-control" id="form-group-input-1" value="{{$tariff->amount}}">
</fieldset>
<button type="submit" class="btn btn-primary pull-right">MAJ</button>
</form>
</div>
</div>
</div>
</div>
</div>
#endsection
My problem is now in navbar.blade.php how should I do that 250 can interact with my edit / update function?
<span style="font-size: 22px;color: #0d3863;font-weight: bold;"> 250</span>
Thank you
I don't have experience with laravel but i guess like any other php framework you can echo variable from controller to view
<span style="font-size: 22px;color: #0d3863;font-weight: bold;"> <?php echo $variable ?></span>
after some googling: You can pass data to the view using the with method.
return View::make('blog')->with('posts', $posts);
Home.php(file in controller)
<?php
class Home extends CI_Controller {
public function index() {
$this->load->helper('url');
//display home page
$this->load->view('home.html');
}
}
?>
home.html(file in view page)
<!DOCTYPE html>
<html lang="en">
<head>
<title>PortFolio Website</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
/* Remove the navbar's default margin-bottom and rounded borders */
.navbar {
margin-bottom: 0;
border-radius: 0;
}
body, html {
height: 100%;
margin: 0;
}
/* First Container */
.bg {
/* The image used */
background-image: url("1.jpg");
/* Full height */
height: 60%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
#media (max-width: 800px) {
.bg {
height:80%;
}
}
/* Second container */
.bg1 {
background-color: #f77a55;
height:45%;
}
#media (max-width: 800px) {
.bg1 {
height:70%;
}
}
/* Third container */
.bg2 {
height:40%;
}
#media (max-width: 800px) {
.bg2 {
height:100%;
}
}
/* Fourth container */
.bg3 {
background-color: #404040;
height:60%;
}
#media (max-width: 800px) {
.bg3 {
height:190%;
}
}
/* Add a gray background color and some padding to the footer */
footer {
background-color: #404040;
padding: 25px;
}
</style>
</head>
<body>
<!--Navigation Bar-->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Full-stack Developer</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<!--li class="active">Home</li-->
<li>About Me</li>
<li>Services</li>
<li>Portfolio</li>
<li>Contact</li>
<li>Register</li>
<li><span class="glyphicon glyphicon-log-in"></span> Login</li>
</ul>
</div>
</div>
</nav>
<!--First Container-->
<div class="bg">
<div class="container text-center">
<br><br><br><br><br><br>
<h1 style="color:White"><strong>Ready For? Engaging Website||</strong></h1>
<h2 style="color:White">Inventive Web design, Development & Android Application!</h2>
</div>
</div>
<!--Second Container-->
<div id="AboutMe" class="bg1">
<div class="container text-center">
<br><br><br>
<h1 style="color:White"><strong>About Me</strong></h1>
<br>
<p style="color:White; font-size: 15px"><b>I'm a Full stack developer providing complete Web solutions to the clients. I have a deep technical knowledge combined with the broad digital media work, website designing and development experience means I can provide you with honest suggestions on what can be delivered with your available resource. My aim is to out perform expectations at every possible chance.</b></p>
</div>
</div>
<!--Third Container-->
<div id="Services" class="bg2">
<div class="container text-center">
<br><br><br>
<h1 style="color:#f77a55"><strong>Services</strong></h1>
</div><br><br><br>
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-6 col-xs-12 col-sm-12 text-center">
<i class="fa fa-4x fa-desktop text-primary mb-3 sr-icons"></i>
<h4 class="mb-3">Responsive Web App Development</h4>
</div>
<div class="col-lg-3 col-md-6 col-xs-12 col-sm-12 text-center">
<i class="fa fa-4x fa-tablet text-primary mb-3 sr-icons"></i>
<h4 class="mb-3">Mobile App Development</h4>
</div>
<div class="col-lg-3 col-md-6 col-xs-12 col-sm-12 text-center">
<i class="fa fa-4x fa-television text-primary mb-3 sr-icons"></i>
<h4 class="mb-3">UI/UX Development</h4>
</div>
<div class="col-lg-3 col-md-6 col-xs-12 col-sm-12 text-center">
<i class="fa fa-4x fa-cloud text-primary mb-3 sr-icons"></i>
<h4 class="mb-3">Hosting & Support service</h4>
</div>
</div>
</div>
</div><br><br><br>
<!--Fourth Container-->
<div id="Portfolio" class="bg3">
<div class="container text-center">
<br><br>
<h1 style="color:#f77a55"><strong>Portfolio</strong></h1>
</div><br><br>
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-6 col-xs-12 col-sm-12 text-center">
<img src="<?php echo base_url('image/5.jpg'); ?>" class="img-responsive img-rounded" alt="image" >
<h4 class="mb-3" style="color:orange">Blue Star Power</h4>
<p style="color:white">Blue Star Power Solutions Private Limited are specialists in Diesel Generator Sales and Service, Annual Maintenance.</p>
</div>
<div class="col-lg-3 col-md-6 col-xs-12 col-sm-12 text-center">
<img src="6.jpg" class="img-responsive img-rounded" alt="image" >
<h4 class="mb-3" style="color:orange">Cavotec Inspired Engineering</h4>
<p style="color:white">Global-Airport Solutions is the global industry’s number one meeting place for Airport Operators/Owners,Managers.</p>
</div>
<div class="col-lg-3 col-md-6 col-xs-12 col-sm-12 text-center">
<img src="10.jpg" class="img-responsive img-rounded" alt="image" >
<h4 class="mb-3" style="color:orange">Gemalto Security Free</h4>
<p style="color:white">You will find our identity authentication and data protection technologies at the heart of modern life, Annual Maintenance.</p>
</div>
<div class="col-lg-3 col-md-6 col-xs-12 col-sm-12 text-center">
<img src="11.jpg" class="img-responsive img-rounded" alt="image" >
<h4 class="mb-3" style="color:orange">Singularity University</h4>
<p style="color:white">Our programs and events equip you with the mindset, tools, and resources to successfully journey to the future. </p>
</div>
</div>
</div>
</div><br><br><br>
<!--fiveth container-->
<div id="Contact" class="container">
<h2 class="container text-center" style="color:orange"><b>Let's Get In Touch!</b></h2>
<p class="container text-center" style="color:orange"><span style="font-size: 18px;">Submit the form and we will get back to you as soon as possible!</span></p><br><br>
<form class="form-horizontal" action="">
<div class="form-group">
<label class="control-label col-sm-2" style="color:red">Name:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="name" placeholder="Enter Name" name="name">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" style="color:red">Email:</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="email" placeholder="Enter Email" name="email">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" style="color:red">Contact Number:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="contact_number" placeholder="Enter Contact Number" name="contact_number">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" style="color:red">Subject:</label>
<div class="col-sm-10">
<textarea rows="5" class="form-control" id="subject" placeholder="Enter Reason For Contacting..." name="subject"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-success">Submit</button>
</div>
</div>
</form>
</div><br>
<!--Footer-->
<footer class="container-fluid text-center">
<h4 style="color:white">2018 # Full-Stack Developer</h4>
<p style="color:white">All Rights Reserved</p>
</footer>
</body>
</html>
I have done a simple design with bootstrap, which is working fine in local host but when i try to enter it in my codeignitor folder its not working, i mean to say the images
which are their in the page are not getting displayed when i tried it to open via codeignitor, i have saved all my images in view folder itself, i know this is really
a stupid question.
i tried with this but its not working
<img src="<?php echo base_url('image/5.jpg'); ?>" class="img-responsive img-rounded" alt="image" >
you can't use .html file, because in html file you can't write php code.
helper 'url' must be loaded in autoload.php, either in view page you have to load again helper url.
You should not store images in view folder.
You should check some following step-
1) first fix your project base_url which is set in application/config/config.php
2) create a folder(e.g: image) on application location for save all images. then you can
save any img(e.g:5.jpg) in this folder which you are want.
3) on final step where you want to display image use code like this-
<img src="<?php echo base_url();?>/image/5.jpg">
If your images are in public/images directory and your
Base URL is
(you can check/set your base URL in /application/config/config.php
$config['base_url'] = 'enter your base path here';
)
if your basepath is
www.yoururl.com/
then use path
<img src="<?php echo base_url();?>public/image/5.jpg">