Jump to content

mdvignesh

Members
  • Posts

    60
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

mdvignesh's Achievements

Member

Member (2/5)

0

Reputation

  1. public function editContact( $c_id = null ) { //echo $c_id; if( !$c_id ) { throw new NotFoundException( __( 'Invalid Post' ) ); } $contact = $this->Contact->findBycId( $c_id ); if( !$contact ) { throw new NotFoundException( __( 'Invalid Post' ) ); } //$id = $c_id; if( $this->request->is( array( 'post', 'put' ) ) ) { $this->Contact->cid = $c_id; if( $this->Contact->save( $this->request->data ) ) { $this->Session->setFlash( __( 'Data Updated' ) ); return $this->redirect( array( 'action' => 'index' ) ); } $this->Session->setFlash( __( 'Unable To update Data!' ) ); } if( !$this->request->data ) { $this->request->data = $contact; } } edit action in my controller in my contacts table I'm having 'c_id' instead of 'id' I also add this public $primaryKey = 'c_id' in Contact.php model file But still I get column not found unknown column contact.id in where clause
  2. I am doing Photo gallery using cakephp and flickr by seeing this link http://www.sitepoint.com/photo-gallery-cakephp-flickr/# I am getting Error: Class 'phpFlickr' not found File: C:\wamp\www\cake\app\Controller\Component\flickrComponent.php Line: 28 This is my flickrComponent.php <?php /** * Flickr Component * @author RosSoft * @license MIT * @version 0.1 */ define(‘FLICKR_CACHE_DIR’,CACHE . ‘flickr/’); class FlickrComponent extends Object { /** * Api Key. Change to your own * @var string * @link http://www.flickr.com/services/api/misc.api_keys.html */ //var $_api_key=’CHANGE_TO_YOUR_KEY’; var $_api_key='55d16262ee69f739466b7c45b073cc8a'; function startup(&$controller) { App::import('Vendor', 'phpFlickr', array('file' => 'phpflickr'.DS.'phpFlickr'.DS.'phpFlickr.php')); //vendor(‘phpflickr/phpFlickr’); //FlickrComponent instance of controller is replaced by a phpFlickr instance $controller->flickr =& new phpFlickr($this->_api_key); if (!is_dir(FLICKR_CACHE_DIR)) { mkdir(FLICKR_CACHE_DIR,0777); } $controller->flickr->enableCache(‘fs’, FLICKR_CACHE_DIR); $controller->set(‘flickr’,$controller->flickr); } } ?> This is my gallerycontroller.php <?php class GalleryController extends AppController { var $name = 'Gallery'; var $components = array('Flickr'); var $uses = null; } ?>
  3. I created a password in wamp server than i added that password in new mysqli("localhost","root","beam","lms") Now iam getting error : Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user ''@'localhost' (using password: NO) in on line 169 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in on line 169 (Before having password thatis without password it was working good)
  4. Thank u very very much. php freaks is the GOD :D
  5. I dont know y if else not working my questions is when i type username in the database it displays username exists but if type something else it does not displays the else part in the if statement signup.php <? include("db.php")?> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript"> function valid() { var un=document.forms[0].dun.value; //alert(un); if(un=="") { alert("Enter username"); document.forms[0].dun.focus(); return false; } var ps=document.forms[0].pass.value; if(ps=="") { alert("Enter password"); document.forms[0].pass.focus(); return false; } var mail=document.forms[0].em.value; if(mail=="") { alert("Enter email"); document.forms[0].em.focus(); return false; } var mobile=document.forms[0].mob.value; if(mobile=="") { alert("Enter mobile"); document.forms[0].mob.focus(); return false; } } </script> <script src="jquery-1.7.1.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#feedback').load('chech.php').show(); $('#username_input').keyup(function() { $.post('chech.php',{ dun:form.dun.value }, function(result) { $('#feedback').html(result).show(); }); }); }); </script> </head> <body> <form name="form" method="post"> <label>Desired Username:</label> <input type="text" id="username_input" name="dun"><div id="feedback"></div> <br><br> <label>Password:</label> <input type="password" name="pass"><br/><br/> <label>Confirm:</label><input type="password" name="pass2"> <br><br> <label>Email:</label> <input type="text" name="em"> <br><br> <label>Mobile:</label> <input type="text" name="mob"> <br><br><br> <input type="submit" name="sub" value="signup" onClick="return valid();"> </form> <? if(isset($_REQUEST['sub'])) { $ins=mysql_query("insert into reg (username ,password ,email ,mobile) values ('".$_REQUEST['dun']."' ,'". $_REQUEST['pass']."','".$_REQUEST['em']."','".$_REQUEST['mob']."') "); if(!$ins) { echo "error"; } else ?> <a href="login.php">Login</a> <? } ?> </body> </html> chech.php <? include("db.php"); if(isset($_POST['dun'])) { //echo $_REQUEST['dun']; $sel=mysql_query("select username from reg where username='".$_REQUEST['dun']."' "); $count=mysql_num_rows($sel) or die(mysql_error()); echo $count; if($count>0) { echo "username exists"; } else echo "not exists"; } ?>
  6. here is the code $(".newsticker-jcarousellite2").jCarouselLite({ horizontal: true, hoverPause:true, visible: 3, auto:5000, speed:1000, btnNext: ".prev", btnPrev: ".next" });
  7. On page load the jcarousellite comes vertically and after that it comes correctly I want to load horizontally the jcarousellite slide I downloaded from here http://www.htmldrive.net/items/show/397/Vertical-Scrolling-News-Ticker-With-jQuery-jCarouse and modified horizontal:true How to do that see this http://cineaxis.com/
  8. Facebook share fetches all pictures from my site when i click the button which i get from addthis.com I found one solution but i dont know how to use it - <meta tag> in head tag See this link http://www.cineaxis.com/news-details.php?id=451
  9. how to use foriegn key in insert query I am having a comment form for each video like youtube having 2 tables one for video details and one for comments insert into cae_comments (c_id,comments_date,comments,approve_com) values ('".$_REQUEST['id']."','".date("Y-m-d")."' ,'".trim($_POST['txtarea'])."',NULL) i set c_id as foreign key and primary key v_id in 2nd table
  10. on page load pop up comes for selecting tv or movies (session is started in conn.php) if tv is selected session['select'] = 'tv_sotime' same for movies Now i want to change the selection I kept a link 'CHANGE' for selection i will unset session['select'] by passing variable on session.php but when i load /entertainment.php the pop up should not come Thank U... index.php <? include("conn.php"); //require('_drawrating.php'); $pagename="Entertainment"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?=$settings->ScriptName?> | <?=$pagename?></title> <link rel="shortcut icon" href="images/favicon.ico" /> <link rel="shortcut icon" type="images/png" href="images/favicon.png" /> <link rel="shortcut icon" type="images/png" href="images/favicon.gif" /> <link rel="stylesheet" href="style.css" type="text/css" media="all" /> <link rel="stylesheet" href="css/cnelstyle.css" type="text/css" media="all" /> <link media="screen" rel="stylesheet" href="css/colorbox.css" /> <script src="js/jquerylatestmin.js" type="text/javascript"></script> <script src="js/jquery.colorbox-min.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { $(window).bind('load', function(e) { $.colorbox({ 'width' : 300, 'height' : 130, 'transitionIn' : 'none', 'transitionOut' : 'elastic', 'centerOnScroll' : 'true', 'overlayOpacity' : 0.2, 'overlayColor' : '#000', 'modal' : 'true', href:"select.php"}); }); }); </script> </head> <body> <? //require_once("fb.php")?> <div id="wrap"> <? include('header.php'); include("session.php"); ?> <div class="wraper"> <div class="middle"> <div class="ad"><?=stripslashes($adsense->Ads7)?></div> </div> <div class="clr"></div> </div> </div> <div class="footer"> <div class="wraper"> <?php include("footer.php"); ?> </div> </div> </body> </html> tv_sotime.php <?php include("conn.php"); $pagename="TV SHOWTIME"; $_SESSION['select'] = 'tv_sotime'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> <?=$settings->ScriptName?> | <?=$pagename?> </title> <link rel="shortcut icon" href="images/favicon.ico" /> <link rel="shortcut icon" type="images/png" href="images/favicon.png" /> <link rel="shortcut icon" type="images/png" href="images/favicon.gif" /> <link rel="stylesheet" href="css/cnelstyle.css" type="text/css" media="all" /> <link rel="stylesheet" href="style.css" type="text/css" media="all" /> <link rel="stylesheet" href="jscss/main.css" /> <script type="text/javascript" src="jscss/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="jscss/main.js"></script> </head> <body> <? //include("customjqmodalbox.php"); require_once("fb.php"); ?> <div id="wrap"> <? include('header.php')?> <div class="wraper"> <div class="middle"> <div class="middle_content"><a href="session.php?curr=c">Change</a></div> <div id="page"> <ul class="mytabs" id="tabs"> <li class="title"> <h2><strong>What's on Today?</strong></h2> <? //date('l M d Y')?> </li> <!-- <li class="todaydate"> <h2></h2> </li>--> <li class="current"><a href="tab-1.html">Movies</a></li> <li><a href="tab-2.html">Reality</a></li> <li><a href="tab-3.html">Sports</a></li> </ul> <div class="mytabs-container" id="tabs-container"> Loading... </div> </div> <!-- page --> <div class="ad"> <?=stripslashes($adsense->Ads7)?> </div> <div class="ss"> <h3 id="cat_head">Categories</h3> <ul> <li><a href="#">Drama</a></li> <li><a href="#">TV Programs</a></li> <li><a href="#">Special Programs for special Day</a></li> </ul> <img src="images/cineaxis.png" alt="" /> </div> </div> </div> <div class="clr"></div> </div> </div> <!-- warp --> <!--<div class="fb-like-box" data-href="http://www.facebook.com/CineAxis" data-width="198" data-height="274" data-show-faces="true" data-border-color="#E8E8E8" data-stream="false" data-header="false"> </div>--> <div class="footer"> <div class="wraper"> <?php include("footer.php"); ?> </div> </div> </body> </html> <? include("conn.php"); //session_start(); if(isset($_GET['curr']) == 'c') { unset($_SESSION['select']); //session_destroy(); header("Location:index.php"); } if(isset($_SESSION['select'])) { if($_SESSION['select'] == 'tv_sotime') { $page = 'tv_sotime.php'; header("Location:$page"); } if($_SESSION['select'] == 'movie_sotime') { $page2 = 'movie_sotime.php'; header("Location:$page2"); } } ?>
  11. i want a page with alert on page load for selecting country background click must be disabled and escape key should be disabled
  12. First, I will select checkbox then click generate report then it displays the items with download link Then i click download link to download the selected checkbox values in pdf I want to download the selected checkbox items by clicking download link Now i am getting all check box items in the pdf download How to download only the selected check box items <?php session_start(); $_SESSION['pidd'] = 2; $sessvar = $_SESSION['pidd']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Document</title> <link rel="stylesheet" type="text/css" href="css/style.css" /> <style type="text/css" media="print"> DIV#noprint{visibility:hidden;} INPUT#printbutt{visibility:hidden;} #downloadlink{visibility:hidden;} </style> <script type="text/javascript"> function gen() { var st1=document.getElementById("ckbox1").checked; var st2=document.getElementById("ckbox2").checked; var st3=document.getElementById("ckbox3").checked; var st4=document.getElementById("ckbox4").checked; if(st1 == true) { document.getElementById('g1').style.display = 'block'; } if(st2 == true) { document.getElementById('g2').style.display = 'block'; } if(st3 == true) { document.getElementById('g3').style.display = 'block'; } if(st4 == true) { document.getElementById('g4').style.display = 'block'; } document.getElementById('p_info').style.display = 'none'; document.getElementById('histree').style.display = 'none'; document.getElementById('insurence').style.display = 'none'; document.getElementById('billin').style.display = 'none'; } function showuser() { document.getElementById('g1').style.display = 'none'; document.getElementById('g2').style.display = 'none'; document.getElementById('g3').style.display = 'none'; document.getElementById('g4').style.display = 'none'; var str1=document.getElementById("ckbox1").checked; var str2=document.getElementById("ckbox2").checked; var str3=document.getElementById("ckbox3").checked; var str4=document.getElementById("ckbox4").checked; if(str1 == true) { document.getElementById('p_info').style.display = 'block'; } else document.getElementById('p_info').style.display = 'none'; if(str2 == true) { document.getElementById('histree').style.display = 'block'; } else document.getElementById('histree').style.display = 'none'; if(str3 == true) { document.getElementById('insurence').style.display = 'block'; } else document.getElementById('insurence').style.display = 'none'; if(str4 == true) { document.getElementById('billin').style.display = 'block'; } else document.getElementById('billin').style.display = 'none'; } function checkByParent(aId, aChecked) { var collection = document.getElementById(aId).getElementsByTagName('INPUT'); for (var x=0; x<collection.length; x++) { if (collection[x].type.toUpperCase()=='CHECKBOX') collection[x].checked = aChecked; } } </script> </head> <body> <div id="main_content"> <div id="left"> <div id="noprint"> <h4>Patient Report</h4> <a id="check_all" href="#" style="text-decoration:none" onClick="checkByParent('checkboxes', true); return false;">check all</a> <a id="uncheckall" href="#" style="text-decoration:none" onClick="checkByParent('checkboxes', false); return false;">uncheck all</a> <br> <br> <form method="post" name="myform" action=""> <div id="checkboxes"> <div id="cb_id1"> <input id="ckbox1" name="cbox1" type="checkbox" <? if(isset($_REQUEST['cbox1'])) echo 'checked="checked"' ; ?> value="p_info" /> Patient Info </div> <div id="cb_id2"> <input id="ckbox2" name="cbox2" type="checkbox" <?php if(isset($_REQUEST['cbox2'])) echo 'checked="checked"' ; ?> value="histree" /> History </div> <div id="cb_id3"> <input id="ckbox3" name="cbox3" type="checkbox" <?php if(isset($_REQUEST['cbox3'])) echo 'checked="checked"' ; ?> value="insurance" /> Insurence </div> <div id="cb_id4"> <input id="ckbox4" name="cbox4" type="checkbox" <?php if(isset($_REQUEST['cbox4'])) echo 'checked="checked"' ; ?> value="billin" /> Billing </div> </div> <!--checkboxes div --> <br> <input id="vuprint" name="view" type="button" value="View" onClick="showuser();"> <hr/> <label for="docs"> Documents:<br> <br> </label> <input name="sub" type="button" value="Generate report" onclick="gen();"> <hr/> </form> <input id="printbutt" name="prt" type="button" value="Print" onClick="javascript:window.print();"> </div> <!--No print --> </div> <!--Left div --> <div id="side"> <div id="p_info"> <?php require("db_conn.php"); $pinfo = mysqli_query($mysqli,"SELECT * FROM patient_datas WHERE P_Id='".$sessvar."' "); while($fet = mysqli_fetch_array($pinfo)) { echo "<h4>Patient Info</h4>"; echo "<b>Name: </b>" . $fet["P_Fname"] . " " . $fet["P_Lname"]. "<br>"; echo "<b>Dob:</b> " . date("d-m-Y",strtotime($fet["P_Dob"]))."<br>"; echo "<b>Age:</b> " . $fet["P_Age"]."<br>"; echo "<b>Gender:</b> " . $fet["P_Gender"]."<br>"; echo "<b>Marital Status:</b> " . $fet["P_Mstatus"]."<br>"; echo "<b>Blood: </b>" . $fet["P_Blood"]."<br>"; echo "<b>Height: </b>" . $fet["P_Height"] . $fet["P_Hval"]."<br>"; echo "<b>Weight: </b>" . $fet["P_Weight"] . $fet["P_Wval"]; } ?> </div> <div id="histree"> <?php $his = mysqli_query($mysqli,"SELECT * FROM patient_datas WHERE P_Id='".$sessvar."' "); while($hisrow = mysqli_fetch_array($his,MYSQLI_ASSOC)) { echo "<h4>Patient Histroy</h4>"; echo "<b>P_Idate: </b>" . date("d-m-Y",strtotime($hisrow["P_Idate"]))."<br>"; echo "<b>P_Edate: </b>" . date("d-m-Y",strtotime($hisrow["P_Edate"]))."<br>"; echo "<b>D_Ddate: </b>" . date("d-m-Y",strtotime($hisrow["D_Ddate"])); } ?> </div> <!-- Insurence --> <div id="insurence"> <?php $insu = mysqli_query($mysqli,"SELECT * FROM patient_datas WHERE P_Id='".$sessvar."' "); while($insrow = mysqli_fetch_array($insu,MYSQLI_ASSOC)) { ?> <?php echo "<h4>Insurence</h4>"; echo "<b>P_Isname: </b>" . $insrow["P_Isname"]."<br>"; // echo $insow[""]; } ?> </div> <div id="billin"> <?php $bilrow = mysqli_query($mysqli,"SELECT * FROM patient_datas WHERE P_Id='1' "); while($bill = mysqli_fetch_array($bilrow,MYSQLI_ASSOC)) { ?> <?php echo "<h4>Billing</h4>"; echo "<b>P_Fbill: </b>" . $bill["P_Fbill"]."<br>"; echo "<b>Fees: </b>" . $bill["fees"]; } ?> </div> </div> <!--/side div --> <div id="generatereport"> <div id="g1" style="display:none; clear:both;"> <label for="Gen_reports">Generaterd reports</label> <br /> <br /> <?php $pinfo = mysqli_query($mysqli,"SELECT * FROM patient_datas WHERE P_Id='1' "); while($fet = mysqli_fetch_array($pinfo,MYSQLI_ASSOC)) { $new_dob = date("d-m-Y",strtotime($fet["P_Dob"])); ?> <?php echo "<h4>Patient Info</h4>"; echo "<b>Patient Id:</b> ". $fet["P_Id"]."<br>"; echo "<b>Name:</b> " . $fet["P_Fname"] . " " . $fet["P_Lname"]."<br>"; echo "<b>Dob:</b> " . $new_dob ."<br>"; echo "<b>Age:</b> " .$fet["P_Age"]."<br>"; echo "<b>Gender:</b> " . $fet["P_Gender"]."<br>"; echo "<b>Marital Status:</b> " . $fet["P_Mstatus"]. "<br>"; echo "<b>Blood:</b> " . $fet["P_Blood"] . "<br>"; echo "<b>Height:</b> " . $fet["P_Height"] . $fet["P_Hval"]. "<br>"; echo "<b>Weight:</b> " . $fet["P_Weight"] . $fet["P_Wval"]. "<br>"; } echo "*************************************************************************************************************************"; ?> </div> <div id="g2" style="display:none"> <?php $his = mysqli_query($mysqli,"SELECT * FROM patient_datas WHERE P_Id='1' "); while($secrow = mysqli_fetch_array($his,MYSQLI_ASSOC)) { echo "<h4>Patient Histroy</h4>"; echo "<b>P_Idate:</b> " . date("d-m-Y",strtotime($secrow["P_Idate"])) ."<br>"; echo "<b>P_Edate:</b> " . date("d-m-Y",strtotime($secrow["P_Edate"])) ."<br>"; echo "<b>D_Ddate:</b> " . date("d-m-Y",strtotime($secrow["D_Ddate"])) ."<br>"; } echo "*************************************************************************************************************************"; ?> </div> <div id="g3" style="display:none"> <?php $insu = mysqli_query($mysqli,"SELECT * FROM patient_datas WHERE P_Id='1' "); while($insrow = mysqli_fetch_array($insu,MYSQLI_ASSOC)) { echo "<h4>Insurence</h4>"; echo "<b>P_Isname:</b>" . $insrow["P_Isname"]."<br>"; } echo "*************************************************************************************************************************"; ?> </div> <div id="g4" style="display:none"> <?php $bilrow = mysqli_query($mysqli,"SELECT * FROM patient_datas WHERE P_Id='1' "); while($bill = mysqli_fetch_array($bilrow,MYSQLI_ASSOC)) { echo "<h4>Billing</h4>"; echo "<b>P_Fbill:</b> " . $bill["P_Fbill"]."<br>"; echo "<b>Fees:</b> " . $bill["fees"]; } ?> </div> <?php $infochk = 'p_info'; $hischk = 'histree'; $insuchk = 'insurance'; $billchk = 'billin'; ?> <a id="downloadlink" href="download_pdf2.php?info=<?php if(isset($infochk)) echo $infochk; ?>&hist=<?php if(isset($hischk)) echo $hischk; ?>&insu=<?php if(isset($insuchk)) echo $insuchk; ?>&billin=<?php if(isset($billchk)) echo $billchk; ?>">Download</a> </div> <!--generate report --> </div> <!--/main_coontent --> </body> </html>
  13. Help to solve i am getting Access denied for user 'SYSTEM'@'localhost' (using password: NO) phpclasspagination <html> <head> <link rel="stylesheet" href="style.css" type="text/css" /> </head> <body> <?php //$dbHost = 'localhost'; //$dbUser = 'root'; //$dbPass = ''; //$dbName = 'pagination'; //$mysqli = new mysqli($dbHost, $dbUser, $dbPass, $dbName); require("CSSPagination.class.php"); $sql1 = "SELECT * FROM records WHERE active='1' ORDER BY name"; $rowsperpage = 5; $website = $_SERVER['PHP_SELF']."?id=1"; $pagination = new CSSPagination($sql1, $rowsperpage, $website); $pagination->setPage($_GET ); // dont change it echo $pagination->showPage(); $sql2="SELECT * FROM records ORDER BY name ASC LIMIT " . $pagination->getLimit() . ", " . $rowsperpage; $dbcon=mysql_connect($dbHost, $dbUser, $dbPass); mysql_select_db("pagination",$dbcon); $result = @mysql_query($sql2, $mysqli) or die("failed"); //$result = $mysqli->query($sql2); //$rows = $result->fetch_array(MYSQLI_ASSOC) while($rows = mysql_fetch_array($result)) { echo $rows["name"]; echo "<br>"; echo $rows["id"]; } echo $pagination->showPage(); // Show the pagination index //ob_end_flush(); ?> </body> </html> CSSPagination.class <?php class CSSPagination { private $totalrows; private $rowsperpage; private $website; private $page; private $sql; public function __construct($sql, $rowsperpage, $website) { $this->sql = $sql; $this->website = $website; $this->rowsperpage = $rowsperpage; } public function setPage($page) { if (!$page) { $this->page=1; } else { $this->page = $page; } } public function getLimit() { return ($this->page - 1) * $this->rowsperpage; } private function getTotalRows() { $result = @mysql_query($this->sql) or die ("mdv ". mysql_error()); $this->totalrows = mysql_num_rows($result); } private function getLastPage() { return ceil($this->totalrows / $this->rowsperpage); } public function showPage() { $this->getTotalRows(); $pagination = ""; $lpm1 = $this->getLastPage() - 1; $page = $this->page; $prev = $this->page - 1; $next = $this->page + 1; $pagination .= "<div class=\"pagination\""; if($margin || $padding) { $pagination .= " style=\""; if($margin) $pagination .= "margin: $margin;"; if($padding) $pagination .= "padding: $padding;"; $pagination .= "\""; } $pagination .= ">"; if ($this->getLastPage() > 1) { if ($page > 1) $pagination .= "<a href=$this->website&page=$prev>« prev</a>"; else $pagination .= "<span class=\"disabled\">« prev</span>"; if ($this->getLastPage() < 9) { for ($counter = 1; $counter <= $this->getLastPage(); $counter++) { if ($counter == $page) $pagination .= "<span class=\"current\">".$counter."</span>"; else $pagination .= "<a href=$this->website&page=$counter>".$counter."</a>"; } } elseif($this->getLastPage() >= 9) { if($page < 4) { for ($counter = 1; $counter < 6; $counter++) { if ($counter == $page) $pagination .= "<span class=\"current\">".$counter."</span>"; else $pagination .= "<a href=$this->website&page=$counter/>".$counter."</a>"; } $pagination .= "..."; $pagination .= "<a href=$this->website&page=$lpm1>".$lpm1."</a>"; $pagination .= "<a href=$this->website&page=".$this->getLastPage().">".$this->getLastPage()."</a>"; } elseif($this->getLastPage() - 3 > $page && $page > 1) { $pagination .= "<a href=$this->website&page=1>1</a>"; $pagination .= "<a href=$this->website&page=2>2</a>"; $pagination .= "..."; for ($counter = $page - 1; $counter <= $page + 1; $counter++) { if ($counter == $page) $pagination .= "<span class=\"current\">".$counter."</span>"; else $pagination .= "<a href=$this->website&page=$counter>".$counter."</a>"; } $pagination .= "..."; $pagination .= "<a href=$this->website&page=$lpm1>$lpm1</a>"; $pagination .= "<a href=$this->website&page=".$this->getLastPage().">".$this->getLastPage()."</a>"; } else { $pagination .= "<a href=$this->website&page=1>1</a>"; $pagination .= "<a href=$this->website&page=2>2</a>"; $pagination .= "..."; for ($counter = $this->getLastPage() - 4; $counter <= $this->getLastPage(); $counter++) { if ($counter == $page) $pagination .= "<span class=\"current\">".$counter."</span>"; else $pagination .= "<a href=$this->website&page=$counter>".$counter."</a>"; } } } if ($page < $counter - 1) $pagination .= "<a href=$this->website&page=$next>next »</a>"; else $pagination .= "<span class=\"disabled\">next »</span>"; $pagination .= "</div>\n"; } return $pagination; } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.