Form inputs disabled - html

I have two forms on my page, I wrapped the first with a new class just to restrict it to span5, and from that the forms now appear next to each other horizontally but the first is not allowing you to click into or on the elements at all.
<div class="row">
<div class="greybg-container">
<div class="span5">
<div id="login-container">
<div class="inner-content">
<h4>Login</h4>
<div class="basket-login"><div class="basket-login-text"><?php $seintro = new Page($db,'SiteElements','Login'); echo $seintro->row['pageCopy']; ?></div>
<form method="post" action="<?php echo HTTP_HOST; ?>Site/MyAccount/Login/?basketId=<?php echo $_REQUEST['basketId'] ? $_REQUEST['basketId'] : $basket->row['orderId']; ?>&wishlist=<?php echo $_GET['wishlist']; ?>&categoryId=<?php echo $_GET['categoryId']; ?>&addToBasketSize=<?php echo $_GET['addToBasketSize']; ?>">
<?php if ($errorLogin){ ?>
<span class="error"><?php echo $errorLogin; ?></span>
<?php } ?>
<table class="basket">
<?php foreach($form_login as $each){ ?>
<tr><td class="title"><?php $each->writeLabel(); ?></td>
<td><?php $each->write(); ?></td></tr>
<?php } ?>
<tr>
<td class="title">
<label for="login_userSubmit"></label>
</td>
<td class="form_button">
<input id="login_userSubmit" type="submit" size="" value="Send" onclick="" name="login_userSubmit">
<br>
<a class="grey-link" href="<?php echo HTTP_HOST; ?>Site/MyAccount/ForgotPassword">Forgot Password ?</a>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>
<div id="left">
<div class="inner-content">
<h4>Register</h4>
<div class="basket-login"><div class="basket-login-text"><?php $seintro = new Page($db,'SiteElements','Register'); echo $seintro->row['pageCopy']; ?><?php echo $page->row['pageCopy']; ?></div></div>
<form method="post" enctype="multipart/form-data">
<?php if (is_array($error)){ ?>
<strong>Please Note :</strong> The following errors have occurred
<ul>
<?php foreach($error as $id=>$each){ ?>
<li class="error"><?php $form_signup[$id]->writeLabel($each); ?></li>
<?php } ?>
</ul>
<?php } ?>
<table class="basket">
<?php if($form_signup){ foreach($form_signup as $each){ ?>
<tr>
<td class="title"><?php $each->writeLabel(); ?></td>
<td><?php $each->write(); ?></td>
<?php } } ?>
<tr>
<td class="title">
<label for="signup_submit"></label>
</td>
<td class="form_button">
<input style="width:auto;" id="signup_submit" type="submit" size="" value="Continue Registration" onclick="document.getElementById('action_submit').value='1';document.submit();" name="signup_submit">
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
the second form starts where there is div id="left". ignore the fact it says left, that's the form on the right as you'll see.
http://bit.ly/19fegdi

Span5 is overlapped by the form which on the right side. Add the following css style will fix it.
#left{
float: left;
}

Related

Checking if the data already exist in the wp database

I'm attempting to display a message in red colour if the data already exists in the database but it doesn't seem to be working. This is the code that I'm using.
PHP code:
<?php
/**
* Template Name: Add IP Address
*/
get_header();
?>
<?php
$sql="SELECT * FROM `wp_5wbtdj_ip_based_login` where (start='$start' or end='$end');";
$res=mysqli_query($mysqli,$sql);
if (mysqli_num_rows($res) > 0) {
$row = mysqli_fetch_assoc($res);
if($end==isset($row['end']))
{
echo " End IP already exists";
}
if($start==isset($row['start']))
{
echo "Start IP already exists";
}
}
else{
//do your insert code here or do something (run your code)
}
If($_POST['Submit']){
global $wpdb;
$username = $_POST['username'];
$start = ip2long($_POST['start']);
$end = ip2long($_POST['end']);
If($wpdb ->insert('wp_5wbtdj_ip_based_login',
array(
'username' => $username,
'start' => $start,
'end' => $end
)
)== false) wp_die ('<div class="errormessage">Database insertion failed </div>');
else echo '<div class="successmessage"> Database insertion successfull </div>';
?>
<?php
}
else{
}
?>
HTML code:
<main role="main">
<div class="section section_white section_nopadding_top">
<div class="container">
<div class="row">
<div class="col-md-12">
<br><br>
<div class="wrap">
<form action="" id="postjob" method="post">
<h3 style="margin-left:50px;">IP Based Login</h3>
<hr />
<h4 style="margin-left:50px;">Add IP Range</h4>
<table class="form-table" style="margin-left:50px;">
<tr>
<th scope="row" valign="top">
<label for="username">Username</label><br />
</th>
<td>
<input type="text" size="25" name="username" value="<?php echo do_shortcode('[show_loggedin_as]'); ?>"><br /><br>
</td>
</tr>
<tr>
<div class="wrapper">
<th scope="row" valign="top">
<label for="start_ip">Start IP </label>
</th>
<td>
<input type="text" minlength="7" maxlength="15" size="25" pattern="^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$" name="start" valign="top" required>
</div>
<br><br>
<tr>
<div class="wrapper">
<th scope="row" valign="top">
<label for="start_ip">End IP</label>
</th>
<td>
<input type="text" minlength="7" maxlength="15" size="25" pattern="^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$" name="end" valign="top" required>
</div>
</td>
</tr>
<br>
</table><br />
<input name="Submit" class="button" value="Add IP range" type="Submit" style="margin-left:50px;" />
</form>
</div>
<br /><br />
</div> <!-- /col-md-12 -->
</div> <!-- /row -->
</div><!-- /.container -->
</div> <!-- /section -->
</main><!-- /.container -->
</div>
<?php
get_footer();
Can anyone help to point what I'm doing wrong here?

display table values in view depending on id in codeigniter

I have one view candidate details form in my application.
In that I gave one button called scheduled interview.
So when I click on the button it redirect the page to candidate process page with the candidate_id and user_id in the url.
And in the candidate_process page I have one form with some details and under the form I display all the records from database in data table.
I want to display the records only for the particular candidate.I don't want to display all the records.
Here is my view:
<form method="post" action="" id="form">
<b>Date </b>:<input type="text" name="date" id="date"><br><br>
<input type="hidden" name="candidate_id" value="<?php echo $getCandidate['candidate_id']; ?>">
<input type="hidden" name="user_id" value="<?php echo $getCandidate['user_id']; ?>">
<div class="form-group">
<label><b>Select Interview Type:</b></label>
<select class="form-control" id="interview_type_id" name="interview_type_id" >
<option value="" disabled selected>Interview Type</option>
<?php foreach($interviewtype as $rows) { ?>
<option value="<?php echo $rows->interview_type_id?>"><?php echo ucfirst($rows->interview_type_name)?></option>
<?php } ?>
</select>
</div><br>
<div class="form-group">
<label><b>Select Status:</b></label>
<select class="form-control" id="status_type_id" name="status_type_id" >
<option value="" disabled selected>Status Type</option>
<?php foreach($statustype as $rows) { ?>
<option value="<?php echo $rows->status_type_id?>"><?php echo ucfirst($rows->status)?></option>
<?php } ?>
</select>
</div><br>
<button type="submit" name="submit" value="submit" class="btn btn-primary" value="submit">Submit</button>
<button type="submit" id="submit" name="submit" class="btn btn-primary" value="schedule" onclick="ScheduleNextRound();">Schedule Next Round</button><br></br>
</form>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h3>Reports</h3>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-body">
<table id="example1" class="table table-bordered table-hover">
<thead>
<tr>
<th>Interview Date</th>
<th>Candidate</th>
<th>interview</th>
<th>status</th>
<th>Vendor</th>
</tr>
</thead>
<?php foreach ($view_candidates as $idata){ ?>
<tbody>
<tr id="domain<?php echo $idata->candidate_seletion_id;?>">
<td><?php echo $idata->date;?></td>
<td><?php echo $idata->f_name;?></td>
<td><?php echo $idata->interview_type_name;?></td>
<td><?php echo $idata->status;?></td>
<td><?php echo $idata->first_name;?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</div>
</section>
</div>
Controller:
function candidate_process($candidateid,$userid){
$data["msg"]="";
$this->load->model('CandidateModel');
$data['statustype']=$this->CandidateModel->getstatustypes();
$data['interviewtype']=$this->CandidateModel->getinterviewtypes();
$data['candidate']=$this->CandidateModel->getcandidates();
$data['usertype']=$this->CandidateModel->getvendors();
$data['getCandidate'] = $this->CandidateModel->get_candidate_detail($candidateid);
$data['view_candidates'] = $this->CandidateModel->getcandidateselection();//this is my table view
if($this->input->post('submit')=="submit"){
$this->CandidateModel->add_candidate_selection($this->input->post());
redirect(base_url('Candidate/view_candidate_selection'));
}
$this->load->view('Candidates/candidate_process',$data);
}
Model1:
public function add_candidate_selection($data){
$data=array(
'candidate_id'=>$this->input->post('candidate_id'),
'user_id'=>$this->input->post('user_id'),
'status_type_id'=>$this->input->post('status_type_id'),
'interview_type_id'=>$this->input->post('interview_type_id'),
'date'=>$this->input->post('date')
);
$this->db->insert('candidate_selection', $data);
//print_r($data);
}
MOdel2:
public function getcandidateselection(){
$this->db->select('*');
$this->db->from('candidate_selection');
$this->db- >join('candidates_details','candidates_details.candidate_id=candidate_selection.candidate_id');
$this->db->join('interview_types','interview_types.interview_type_id=candidate_selection.interview_type_id');
$this->db->join('status_types','status_types.status_type_id=candidate_selection.status_type_id');
$this->db->join('users','users.user_id=candidate_selection.user_id');
$query = $this->db->get();
//echo $this->db->last_query();
return $query->result();
}
Can anyone help me how to do this..
Thanks in advance.
Replace the Following code in your model function
function getcandidateselection($candidateid)
{
$this->db->join('candidate_selection as cs','cs.candidate_id = cd.candidate_id');
$this->db->join('status_types as st','st.status_type_id = cs.status_type_id');
$this->db->where('cd.candidate_id',$candidateid);
$q = $this->db->get('candidates_details as cd');
return $q->result();
}
Hope it will solve your problem

Pieces missing when printing more than first page is printed

I have a program that allows the user to print out all of the pages of a report. So far so good, except that when they are printing page 2 - the end, or even a page other than the first, there is a section that is missing. When the pages show on the screen all the information is there, just not when it is finally printed. The pages are generated through a while loop in php, here is a sample of the code that shows the html:
<div id="page">
<div id="topper">
Book Condition:
<?php echo $cond;?>
Enter the PO that you would like to review: <?php echo $po;?><span id="record">Record <?php echo $x;?> of <?php echo $pages;?></span>
</div>
<div id="result">
<div class="width border cl">
CL <?php echo $cl;?>
</div>
<div id="recv" class="width border">
REC: <?php echo $qty;?>
</div>
<div id="pricePd" class="width border">
COST: <?php echo $paid;?>
</div>
<div id="words">
<div class="border old">Guide - Old</div>
<div class="border mid">Qty Rem: <?php echo $qtyRem;?></div>
<div class="border current">Guide - Current</div>
</div><!--WORDS-->
<div id="box" class="border">
<input value="<?php echo $title;?>" style="width: 200px;" placeholder="Title"/><br>
<input value="<?php echo $isbn10;?>" style="width: 200px;" placeholder="ISBN10"/><br>
<input id="isbn" value="<?php echo $isbn;?>" style="width: 200px;" placeholder="ISBN13" /><br>
</div><!--BOX-->
<div id="code" class="border">
<div id="barcode" >
<?php
echo '<img src="isbn/' .$isbn.'.jpg" width="200px;"height="100px;">';
?>
</div>
it is everything in the div with the id of "box" that does not print, except on the very first page.This only seems to happen in Firefox, when I print in chrome, all the info is there.
Can anyone shed some light on this for me?

I want to make the background image of joomla login be full width

I have custimized the css of my joomla login page, everything is perfect, but I would like the image that I have inserted in the background through css to scale to whole width. Right now it is of a certain width size, despite the fact that in my css I have added width:100%.
Here is the login code:
<?php
/**
* #package Joomla.Site
* #subpackage com_users
* #copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* #license GNU General Public License version 2 or later; see LICENSE.txt
* #since 1.5
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
?>
<div class="login<?php echo $this->pageclass_sfx?>">
<?php //if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1 class="title">
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php //endif; ?>
<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
<div class="login-description">
<?php endif ; ?>
<?php if (($this->params->get('login_image')!='')) :?>
<img src="<?php echo $this->escape($this->params->get('login_image')); ?>" class="login-image" alt="<?php echo JTEXT::_('COM_USER_LOGIN_IMAGE_ALT')?>"/>
<?php endif; ?>
<?php if($this->params->get('logindescription_show') == 1) : ?>
<?php echo $this->params->get('login_description'); ?>
<?php endif; ?>
<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
</div>
<?php endif ; ?>
<form class="form-horizontal" action="<?php echo JRoute::_('index.php?option=com_users&task=user.login'); ?>" method="post">
<fieldset class="well">
<?php foreach ($this->form->getFieldset('credentials') as $field): ?>
<?php if (!$field->hidden): ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
<div class="control-group">
<label id="remember-lbl" class="control-label" for="remember"><?php echo JText::_('JGLOBAL_REMEMBER_ME') ?></label>
<input id="remember" type="checkbox" name="remember" class="inputbox" value="yes" alt="<?php echo JText::_('JGLOBAL_REMEMBER_ME') ?>" />
</div>
<?php endif; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn-send"><?php echo JText::_('JLOGIN'); ?></button>
<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('login_redirect_url', $this->form->getValue('return'))); ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</div>
</fieldset>
</form>
</div>
<div class="other-link">
<ul class="yt-list type-square">
<li class="pull-left">
<a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_RESET'); ?></a>
</li>
<?php
$usersConfig = JComponentHelper::getParams('com_users');
if ($usersConfig->get('allowUserRegistration')) : ?>
<li class="pull-right">
<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REGISTER'); ?></a>
</li>
<?php endif; ?>
</ul>
</div>
Don't modify core Joomla files, learn about overrides (1, 2 & 3) and use them, that way when a security update is released you can apply it safely and not have to worry about your changes being overwritten.
Did you mean backgroud-size: 100% rather than width: 100%? That would make more sense for background images. In that case, I would recommend reading this primer on "Scaling background images"
To help further we will need to see your existing CSS that you've created and either a link showing the problem or a good screen shot of the issue.

Submit on Radio button change

How can it be done to submit when i change radio button from On to Off or from Off to On. My HTML code is :)
<div class="centered3">
<div class="wrapper">
<form action="oralive-csv.php" method="post" name="fshi_shkruaj">
<td><input style="margin-bottom:10px; float:right;" type="submit" name="submit" value="Shko Live" /></td>
<table style="width:950px;">
<tr>
<th style="float:left;color:#900;">Titulli</th>
<th style="color:#900;">Nentitulli</th>
<th style="color:#900;">Live</th>
</tr>
<?php $i=0; foreach ($results as $result) : ?>
<tr>
<td style="padding-right:5px;height:1.5em;">
<input type="hidden" name="id<?php echo $i; ?>"value="<?php echo $result['id'] ?>" />
<input type="hidden" name="title<?php echo $i;?>"value="<?php echo htmlspecialchars($result['text'],ENT_NOQUOTES,'UTF-8');?>" />
<div class="textndrysho"><input style="font-size:16px;color:#000;width:200px;" type="text" name="title<?php echo $i;?>" value="<?php echo htmlspecialchars($result['text'],ENT_NOQUOTES,'UTF-8'); ?>" maxlength="32"/>
</td></div>
<td style="padding-right:5px;height:1.5em;">
<input type="hidden" name="id<?php echo $i; ?>"value="<?php echo $result['id'] ?>" />
<input type="hidden" name="subtitle<?php echo $i;?>"value="<?php echo htmlspecialchars($result['subtext'],ENT_NOQUOTES,'UTF-8');?>" />
<div class="textndrysho"><input style="font-size:16px;color:#000;width:400px;" type="text" name="subtitle<?php echo $i;?>" value="<?php echo htmlspecialchars($result['subtext'],ENT_NOQUOTES,'UTF-8'); ?>" maxlength="45"/>
</td></div>
<td style="padding-right:5px;height:1.5em;">
<input type="hidden" name="id<?php echo $i; ?>"value="<?php echo $result['id'] ?>" />
<input type="hidden" name="vendi<?php echo $i;?>"value="<?php echo htmlspecialchars($result['vendi'],ENT_NOQUOTES,'UTF-8');?>" />
<div class="textndrysho"><input style="font-size:16px;color:#000;width:120px;" type="text" name="vendi<?php echo $i;?>" value="<?php echo htmlspecialchars($result['vendi'],ENT_NOQUOTES,'UTF-8'); ?>" maxlength="12"/>
</td></div>
<td>
<label><input type="radio" name="shfaq<?php echo $i; ?>" value="1" id="radiobuttonsondazh_0" <?php if($result['live']==1) echo 'checked'; ?> onclick="document.getElementById('myForm').submit();" />Po</label>
<label><input type="radio" name="shfaq<?php echo $i; ?>" value="0" id="radiobuttonsondazh_1" <?php if($result['live']==0) echo 'checked'; ?> onclick="document.getElementById('myForm').submit();" />Jo</label>
</td>
<td>
<input type="checkbox" name="chk<?php echo $i; ?>" >Fshi
</td>
</tr>
<?php $i = $i+1;
endforeach;
?>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td><input style="margin-top:26px;" type="submit" name="submit" value="Shko Live" /></td>
</tr>
</table>
<input type="hidden" value="<?php echo $i = $i-1; ?>" name="saka" /> </form>
</div>
</div></center>
I have try it to onChange Submit this form but not lucky. :(
Can anyone please help me?
You may need to use some javascript it has special what they call event handlers. onclick, blclick, etc. There is a way to have javascript and php code mixed together. Maybe this would work. Also what do you want this form to do that way I can help you more easily.
function dosomething()
{
var formelement = document.getElementById['theid'].value; //retrieves the value from the form element
if (formelement == "whatever")
{
window.open("http://www139.net63.net"); //opens a url in a window
}
else
{
alert("This is a popup window");
}
}
====================
<input type="radio" name="whatever" id="theid" value="your value, url etc." onclick="dosomething()">