Jump to content

Sajesh Mohan

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by Sajesh Mohan

  1. i am creating a plugin in wordpress. that need a file uploading option. i use this code <a onclick="return false;" title="Upload image" class="thickbox" id="add_image" href="media-upload.php?type=image&TB_iframe=true&width=640&height=105">Upload Image</a> need to append your Hyperlink to media-upload.php to really make it working ? my issue is that how to get the value to my textbox. but insert to post option is missing <form action="insert_logo.php" method="get" id="post" name="post"> <table width="770" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="4"> </td> </tr> <tr> <td> </td> <td colspan="3"><h3>Add Client Logo</h3></td> </tr> <tr> <td colspan="4"> </td> </tr> <tr> <td width="76" height="34"> </td> <td width="75">Logo</td> <td width="145"><input name="client_logo" id="name="client_logo"" type="text" /></td> <td width="474"><a onclick="return false;" title="Upload image" class="thickbox" id="add_image" href="media-upload.php?type=image&TB_iframe=true&width=640&height=105">Upload Image</a> </td> </tr> <tr> <td> </td> <td>Url</td> <td><input name="name=" id="name=2"client_logo"" type="text" /></td> <td>[Eg: http://www.sitename.com]</td> </tr> <tr> <td> </td> <td> </td> <td><p class="submit"><input name="addlogo" type="submit" id="addlogo" class="button-primary" value="Submit" /></p></td> <td> </td> </tr> <tr> <td colspan="4"> </td> </tr> </table> </form>
  2. $file="../myclients/clients/".$company_name."/Download/".$file_name; $size = filesize($path); // not working i try with function also function formatbytes($file, $type) { switch($type){ case "KB": $filesize = filesize($file) * .0009765625; // bytes to KB break; case "MB": $filesize = (filesize($file) * .0009765625) * .0009765625; // bytes to MB break; case "GB": $filesize = ((filesize($file) * .0009765625) * .0009765625) * .0009765625; // bytes to GB break; } if($filesize <= 0){ return $filesize = 'unknown file size';} else{return round($filesize, 2).' '.$type;} } echo formatbytes($file, "KB"); uploaded file size is 488 kb but it showing "unknown file size" please help me.
  3. my issue is to show preview of a form. the form will have a fck editor . this form is used to update a table. i need to show a preview button on this page and when we click on it should show the preview of the content. i am attaching my code. my problem is this is a update page fck value is taken from Dn "$desc" . when do some changes on editor then i click on preview button should show the changes, here showing only the $dec value from DB not the value i change. <?php session_start(); $uname=$_SESSION['usname']; include("dbconnect.php"); $admin_qry="select * from st_admin where admin_username='$uname'"; $res=mysql_query($admin_qry); $admin_res=mysql_fetch_array($res); $level=$admin_res['level']; include("status.php"); ?> <script language="javascript" src="ajax/ajax.js"></script><?php $pos=$_REQUEST['pos2']; $getqry="select * from st_aboutus where categorys='$pos'"; $resr=mysql_query($getqry); $row=mysql_fetch_array($resr); $cat=$row['categorys']; $img=$row['st_img']; //$description=$row['st_content']; $desc=stripslashes($row['st_content']); $file_name=$row['file_name']; $id=$row['st_id']; ?> <script language="javascript"> function popUpPreview() { // Display a new browser for the user var w = screen.availWidth / 2 - 450; var h = screen.availHeight / 2 - 320; var win = window.open('aboutus-prewiew.php', 'payPopupMain', 'width=900,height=650,left='+w+',top='+h+',scrollbars=1'); } </script> <link href="../css/style.css" rel="stylesheet" type="text/css" /> <form name="sform" id="sform" action="update_aboutus.php" method="post"> <table width="679" height="323" border="0" align="center" cellpadding="0" cellspacing="0" > <tr> <td colspan="5" height="40" align="left" class="page_head" valign="top"> </td> </tr> <tr> <td align="left" class="textfont"> </td> <td align="left" class="textfont"> </td> <td height="40" align="left"> </td> <td height="40" align="left" class="normaltext"><?php if($level=="dataentry" ){} else {echo " Status " ; } ?></td> <td align="left"><span style="padding-left:10px;"> <?php if($level=="dataentry" ){} else { showStatus('st_aboutus','st_id','status',$id) ; } ?> </span></td> </tr> <tr> <td width="170" align="left" class="textfont"> </td> <td width="8" align="left" class="textfont"> </td> <td height="40" colspan="3" align="left"><?php echo $message=$_GET[msg]; ?></td> </tr> <tr> <td height="19" class="listitem" align="right"> </td> <td class="listitem" align="left"> </td> <td height="19" align="left" class="listitem1">Image Size 274 X 420</td> <td colspan="2" align="left"></td> </tr> <tr> <td height="71" class="listitem" align="right">Add Image</td> <td class="listitem" align="left"> </td> <td width="236" height="71" align="left"><input name="logo" type = "text" id="logo" value="<?php echo $img; ?>" size="20" readonly="readonly" class="txtbox" /> <img src="../images/attach.gif" onClick="attachment('logo','logoimage')" class="imagebutton12" /> <img src="../images/remove.gif" onClick="removeattachment('logo','logoimage')" class="imagebutton12" /></td> <td width="265" colspan="2" align="left"><img src="<?php if($img) {echo "aboutus/".$img; } else { echo "../images/photo.gif "; } ?>" width="67" height="62" name="logoimage8" id="logoimage" /> <input type="hidden" name="image1_hiid" id="image1_hiid" value="<?php echo $img; ?>" /></td> </tr> <tr> <td colspan="5" align="left" class="optimumSize" valign="bottom"><!--Optimum size of image is 120 X 105 --></td> </tr> <tr> <td height="10" colspan="2" class="textfont"> </td> <td height="10" colspan="3"><?php include("../FCKeditor/fckeditor.php"); $oFCKeditor = new FCKeditor('desc') ; $oFCKeditor->BasePath = '../FCKeditor/'; /* $oFCKeditor->Value =stripslashes(substr($intro,0,500));*/ $oFCKeditor->Value = $desc; // here we can give size of editor as $oFCKeditor->Width = '600' ; $oFCKeditor->Height = '250' ; $oFCKeditor->Create() ; ?></td> </tr> <tr> <td height="27" align="right" class="listitem"> </td> <td height="27" class="textfont"> </td> <td height="27" align="left" valign="bottom"><span class="listitem1"><?php /*?><?php if($pos!="management" ){} else {echo " Only Upload ".pdf" file";} ?><?php */?></span></td> <td height="27" colspan="2" align="left"> </td> </tr> <?php /*?><?php if($pos!="management" ){} else {echo " <tr> <td height='68' align='right' class='listitem'>Update pdf</td> <td height='68' class='textfont'> </td> <td height='68' align='left'> <input name='logo1' type = 'text' id='logo1' value='$file_name' size='20' readonly='readonly' class='txtbox' /> <img src='../images/attach.gif' onclick=\"attachment('logo1','logoimage1')\" class='imagebutton12' /> <img src='../images/remove.gif' onclick=\"removeattachment('logo1','logoimage1')\" class='imagebutton12' /></td> <td height='68' align='left'><img src=\"aboutus/$file_name\" width='67' height='62' name='logoimage1' id='logoimage1' /></td> </tr> ";} ?><?php */?> <tr> <td height="36" colspan="2"><input type="hidden" name="des" id="des" value="<?php echo $img; ?>" /></td> <td align="left"><input name="preview" type="button" onclick="return popUpPreview();" value="Preview"/></td> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><input type="hidden" name="id" value="<?php echo $id; ?>"><input type="hidden" name="pos" value="<?php echo $pos; ?>"> <input type="hidden" name="image1_hiid1" id="image1_hiid1" value="<?php echo $file_name; ?>" /></td> <td align="left"> <input type="image" name="image" value="Submit" src="../images/submit.gif" alt="Login Details" title="Submit" onclick="return fieldcheck(this.form);"></td> <td colspan="2"> </td> </tr> <tr><td colspan="5" height="10"></td></tr> </table> </form> aboutus-prewiew.php <script type="text/javascript"> document.write(opener.document.sform.logo.value); document.write(opener.document.sform.desc.value); // this value only showing from the database ,i need to get the value to show preview </script>
  4. http://jqueryui.com/demos/tabs/ check this page or use ajax on the button when we click on the image
  5. can u try if(mysql_num_rows($result) == '1')
  6. in Magento shoping cart how to pass the variable values to a jsp page?
  7. i wanto create a new payment module on magento shoping cart. how to do thanks in advance
  8. if(document.sform.chec.checked == false) { alert("Please Accept I Agree Check Box"); document.sform.chec.focus(); return false; }
  9. the code is correct and working me correctly. <?php $conn = mysql_connect("localhost", "root", "");//ignore this xD if (!$conn) { echo "Unable to connect to the database : " . mysql_error(); exit; } if (!mysql_select_db("salhia_arabic")) { echo "Unable to select database mydbname : " . mysql_error(); exit; } $sql = 'SELECT * FROM st_admin'; $result = mysql_query($sql); if (!$result) { echo "Unable to execute query ($sql) in the database : " . mysql_error(); exit; } if (mysql_num_rows($result) == 0) { echo "No rows found, nothing to display."; exit; } while ($row = mysql_fetch_assoc($result)) { echo $row["admin_username"]; } mysql_free_result($result); ?>
  10. if any body copy and paste anything from word to editor some unwanted css also coming with that pasting. when we request the data same css also coming with that. so how to clean data when we request $desc =$_request['contents']; how to solve this issue. please help me.
  11. if any body copy and paste anything from word to editor some unwanted css also coming with that pasting. when we request the data same css also coming with that. so how to clean data when we request $desc =$_request['contents']; how to solve this issue. please help me.
  12. how to copy a full folder from source to destination using php please help me.
  13. on which language you want to show on site. u should specify <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> on the top of the page + use unicode fonts also.if you use arabic language by default it will taken. other wise u should use unicode fonts. second way use font face in css and keep the font on the server and specify the fontname .
  14. wordpress and we keep getting malware in the php files.affected with EVAL & Base64 malware how can i solve the issue.
  15. Knet Payment Gateway Integration -( Kuwait ) Using PHP/Java Brigge on magento how to do Knet payment Gateway integration for magento shoping cart using PHP/Java Bridge. knet is not providing the code for PHP/MySql. please help. Thanks
  16. when i am cutting the character (arabic language,other international languages) with 450 in IE squrebox showing and in Firefox "?" showing. so issue is showing with other languages also . how to slove this issue.. no proplem found with iff we use wordpress.how we can remove ? thanks in advance
  17. i am doing now a Dynamic polling system. but it working perfectly. only issue is it is not supporting international language. please help me... <SCRIPT LANGUAGE="JavaScript" src="ajax.js" > </SCRIPT> <div id="text"></div> <SCRIPT charset="utf-8" language="javascript" type="text/javascript"> <?php include("../Admin/dbconnect.php"); $aquery="select * from smp_quiz where ipoll='YES' "; $aresult= mysql_query($aquery) ; $arow=mysql_fetch_array($aresult); $tm=$arow['tm']; ?> getpoll('<?php echo $tm; ?>'); </SCRIPT> thanks in advance
  18. i need to display one news seperatly on the pages and need to select from admin side. thats why why make tables like this. pls tell me the solution .how it possible to solve this issue thanks
  19. i need to search from multiple tables using like %keyword% . these are the tables CREATE TABLE IF NOT EXISTS `knews_economy` ( `eco_id` int(4) NOT NULL AUTO_INCREMENT, `heading` varchar(600) NOT NULL, `img` varchar(255) NOT NULL, `contents` blob NOT NULL, `summary` varchar(600) NOT NULL, `tags` varchar(600) NOT NULL, `pubdate` varchar(255) NOT NULL, `inews` enum('YES','NO') NOT NULL DEFAULT 'NO', `status` int(2) NOT NULL COMMENT '1 for active 0 for inactive', PRIMARY KEY (`eco_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=45 ; -- -------------------------------------------------------- -- -- Table structure for table `knews_intl` -- CREATE TABLE IF NOT EXISTS `knews_intl` ( `eco_id` int(4) NOT NULL AUTO_INCREMENT, `heading` varchar(255) NOT NULL, `img` varchar(255) NOT NULL, `contents` blob NOT NULL, `summary` varchar(600) NOT NULL, `tags` varchar(600) NOT NULL, `pubdate` varchar(255) NOT NULL, `inews` enum('YES','NO') NOT NULL DEFAULT 'NO', `status` int(2) NOT NULL COMMENT '1 for active 0 for inactive', PRIMARY KEY (`eco_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ; -- -------------------------------------------------------- -- -- Table structure for table `knews_local` -- CREATE TABLE IF NOT EXISTS `knews_local` ( `eco_id` int(4) NOT NULL AUTO_INCREMENT, `heading` varchar(600) NOT NULL, `img` varchar(255) NOT NULL, `contents` blob NOT NULL, `summary` varchar(600) NOT NULL, `tags` varchar(600) NOT NULL, `pubdate` varchar(255) NOT NULL, `inews` enum('YES','NO') NOT NULL DEFAULT 'NO', `status` int(2) NOT NULL COMMENT '1 for active 0 for inactive', PRIMARY KEY (`eco_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ; -- -------------------------------------------------------- -- -- Table structure for table `knews_mnews` -- CREATE TABLE IF NOT EXISTS `knews_mnews` ( `eco_id` int(4) NOT NULL AUTO_INCREMENT, `heading` varchar(255) NOT NULL, `img` varchar(255) NOT NULL, `contents` blob NOT NULL, `tags` varchar(600) DEFAULT NULL, `summary` varchar(600) DEFAULT NULL, `pubdate` varchar(255) NOT NULL, `status` int(2) NOT NULL COMMENT '1 for active 0 for inactive', PRIMARY KEY (`eco_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=41 ; -- -------------------------------------------------------- -- -- Table structure for table `knews_parliment` -- CREATE TABLE IF NOT EXISTS `knews_parliment` ( `eco_id` int(4) NOT NULL AUTO_INCREMENT, `heading` varchar(600) NOT NULL, `img` varchar(255) NOT NULL, `contents` blob NOT NULL, `tags` varchar(600) NOT NULL, `summary` varchar(600) NOT NULL, `pubdate` varchar(255) NOT NULL, `inews` enum('YES','NO') NOT NULL DEFAULT 'NO', `status` int(2) NOT NULL COMMENT '1 for active 0 for inactive', PRIMARY KEY (`eco_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ; -- -------------------------------------------------------- -- -- Table structure for table `knews_sports` -- CREATE TABLE IF NOT EXISTS `knews_sports` ( `eco_id` int(4) NOT NULL AUTO_INCREMENT, `heading` varchar(255) NOT NULL, `img` varchar(255) NOT NULL, `contents` blob NOT NULL, `tags` varchar(600) NOT NULL, `summary` varchar(600) NOT NULL, `pubdate` varchar(255) NOT NULL, `inews` enum('YES','NO') NOT NULL DEFAULT 'NO', `status` int(2) NOT NULL COMMENT '1 for active 0 for inactive', PRIMARY KEY (`eco_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ; how it is doing ? please help me thanks in advance
  20. hi All I have totaly 6 tables . i need to search from these 6 table using keyword search (LIKE Query) in 6 table common field is eco_id. fields are eco_id,heading,img,content,tags......(same field are in the all tables) how we will do the search query. please help me thanks in advance.
  21. function setDiv(){ if(httpObject.readyState == 4){ document.getElementById('oPut').innerHTML = httpObject.responseText; } else { document.getElementById("oPut").innerHTML="<img src=\"images/003.gif\" height=\"20\" width=\"20\" />"; } } window.onload=callPHP; try it
  22. I have a page with select box with values. when i select value need to show the appropriate value of selected category. i done it correctly. my problem is that i inserted a paging script with the selected data. when i go to 2 page selectbox showing empty. how to solve this issue.. this is the page <script language="javascript" src="ajax/ajax.js"></script> <table width="687" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="10" class="normaltext"> </td> <td> </td> </tr> <tr> <td height="32" class="normaltext" align="center">Section <select name="ad_pos" id="ad_pos" onchange="add_ad()"> <option value="">---Select---</option> <option value="Local">Local</option> <option value="Economy">Economy</option> <option value="Politics">Politics</option> <option value="Sports">Sports</option> <option value="Arts">Arts</option> <option value="International">International</option> </select><input name="ad_pos" type="hidden" value="<?php echo $ad_pos;?>" /></td> <td height="32" class="normaltext" align="center"> </td> </tr> <tr> <td height="32" class="normaltext"> </td> <td> </td> </tr> <tr> <td colspan="2"><div id="ban_pos"> </div></td> </tr> <tr> <td height="32" class="normaltext"> </td> <td> </td> </tr> </table> Data selecting page <?Php $pos=$_REQUEST['pos']; ?> <script> function confirmSubmit() { var agree=confirm("Are you sure want to Delete?"); if (agree) return true ; else return false ; } </script> <table width="631" border="0" cellspacing="0" cellpadding="0" align="center" > <tr> <td colspan="3" height="30" align="left" class="page_head"> </td> </tr> <tr> <td width="50"></td> <td width="175"></td> <td width="150"></td> <td width="100"></td> <td width="75"></td> <td width="100"></td> </tr> <tr> <td colspan="6" width="640"> <table width="631" align="center" cellpadding="0" cellspacing="0" class="orngbord" height="25"> <tr > <td colspan="5" align="right" valign="middle"><a href="main.php?content=Ticker" class="textalign">Add News Ticker</a> </td> </tr> <tr class="listheader"> <td width="73" align="center" valign="middle">SL.No</td> <td width="234" align="left"> Headlines</td> <td width="72" align="center">Status</td> <td width="78" align="center">Edit</td> <td width="69" align="center">Delete</td> </tr> <?php include "dbconnect.php"; include("status.php"); $limit=1; $page=$_REQUEST['page']; if(empty($page)) $page=1; $slno=($page-1)*$limit+1; $query="select * from knews_ticker where section='$pos'"; $exe=mysql_query($query) or die(mysql_error()); $total=mysql_num_rows($exe); if ($total==0){ ?> <tr> <td colspan="8" height="25" class="normaltext_bold" align="center"> No Records Found </td> </tr> <?php }else { include "pagerar.php"; $pager = Pagery::getPagerData($total, $limit, $page); $offset = $pager->offset; $limit = $pager->limit; $page = $pager->page; $query_sel="select * from knews_ticker where section='$pos' order by eco_id DESC limit $offset,$limit"; $exe_sel=mysql_query($query_sel) or die(mysql_error()); ?><?php while($list=mysql_fetch_object($exe_sel)) { if($slno%2=='1') { $bg="#CEC3AD"; } else { $bg="#EDD9B1"; } $id=$list->eco_id; $headlines=stripslashes(preg_replace('~\s{2,}~','',$list->heading));//$list->spotlight_heading; ?> <tr bgcolor="<?php echo $bg;?>"> <td height="25" class="listitem" align="center" ><?php echo $slno;?></td> <td class="listitem" > <?php echo substr($headlines,0,240); ?></td> <td class="listitem" align="center" ><?php showStatus('knews_ticker','eco_id','status',$id); //showStatus(table name,idfield,status field, id)?></td> <td align="center"><a href="main.php?content=Edit_Ticker&id=<?php echo $id;?>"><img src="../images/edit.gif" border="0" title="Edit" /></a><input name="id" type="hidden" value="<?php echo $id;?>" /></td> <td align="center"><a href="delete_ticker.php?id=<?php echo $id;?>" onclick="return confirmSubmit()" ><img src="../images/delete.gif" border="0" title="Delete"></a></td> <?php $slno=$slno+1; } ?> </tr> <tr> <td colspan="6" height="15"></td> </tr> <tr> <td colspan="5" style="text-align:right;" height="25" bgcolor="#C2B59B"> <?php if($total>$limit) { $url="main.php?content=List_Ticker"; if ($total > $limit) { if($page>$total-5) { $c=$total-$page; $page1=$page+$c; } else { $page1=$page+5; } } if($page<6) { $d=6-$page; $s=5-$d; $page2=$page-$s; } else { $page2=$page-5; } if ($page == 1) // this is the first page - there is no previous page { // echo "Previous"; } else { // not the first page, link to the previous page echo "<a href=\"$url&page=1\"></a>"; echo " "; echo " "; echo "<a href=\"$url&page=" . ($page - 1) . "\" class=\"normaltext\">Previous</a>"; } if($page<6) { for ($i = 1; $i <= $pager->numPages; $i++) { echo " | "; if ($i == $page) echo "","$i"; else echo "<a href=\"$url&page=$i\" class=\"normaltext\">$i</a>"; } echo " | "; } else { for ($i = $page2; $i <= $page; $i++) { echo " | "; if ($i == $page) echo "$i"; else echo "<a href=\"$url&page=$i\">$i</a>"; } //// } if ($page == $pager->numPages) // this is the last page - there is no next page { echo ""; } else { // not the last page, link to the next page echo "<a href=\"$url&page=" . ($page + 1) . "\" class=\"normaltext\">Next</a>"; echo ""; echo "<a href=\"$url&page=".$total."\"></a>"; } }?> </td> </tr> <tr> <td colspan="5" style="text-align:right;" height="25" > </td> </tr> <?php }?> </table> please help me...? thanks in advance
  23. First page <script language="javascript" src="ajax/ajax.js"></script> <table width="687" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="10" class="normaltext"> </td> <td> </td> </tr> <tr> <td height="32" class="normaltext" align="center">Section <select name="ad_pos" id="ad_pos" onchange="add_ad()"> <option value="">---Select---</option> <option value="Local">Local</option> <option value="Economy">Economy</option> <option value="Politics">Politics</option> <option value="Sports">Sports</option> <option value="Arts">Arts</option> <option value="International">International</option> </select><input name="ad_pos" type="hidden" value="<?php echo $ad_pos;?>" /></td> <td height="32" class="normaltext" align="center"> </td> </tr> <tr> <td height="32" class="normaltext"> </td> <td> </td> </tr> <tr> <td colspan="2"><div id="ban_pos"></div></td> </tr> <tr> <td height="32" class="normaltext"> </td> <td> </td> </tr> </table> Content page <?Php $pos=$_REQUEST['pos']; ?> <script> function confirmSubmit() { var agree=confirm("Are you sure want to Delete?"); if (agree) return true ; else return false ; } </script> <table width="631" border="0" cellspacing="0" cellpadding="0" align="center" > <tr> <td colspan="3" height="30" align="left" class="page_head"> </td> </tr> <tr> <td width="50"></td> <td width="175"></td> <td width="150"></td> <td width="100"></td> <td width="75"></td> <td width="100"></td> </tr> <tr> <td colspan="6" width="640"> <table width="631" align="center" cellpadding="0" cellspacing="0" class="orngbord" height="25"> <tr > <td colspan="5" align="right" valign="middle"><a href="main.php?content=Ticker" class="textalign">Add News Ticker</a> </td> </tr> <tr class="listheader"> <td width="73" align="center" valign="middle">SL.No</td> <td width="234" align="left"> Headlines</td> <td width="72" align="center">Status</td> <td width="78" align="center">Edit</td> <td width="69" align="center">Delete</td> </tr> <?php include "dbconnect.php"; include("status.php"); $limit=1; $page=$_REQUEST['page']; if(empty($page)) $page=1; $slno=($page-1)*$limit+1; $query="select * from knews_ticker where section='$pos'"; $exe=mysql_query($query) or die(mysql_error()); $total=mysql_num_rows($exe); if ($total==0){ ?> <tr> <td colspan="8" height="25" class="normaltext_bold" align="center"> No Records Found </td> </tr> <?php }else { include "pagerar.php"; $pager = Pagery::getPagerData($total, $limit, $page); $offset = $pager->offset; $limit = $pager->limit; $page = $pager->page; $query_sel="select * from knews_ticker where section='$pos' order by eco_id DESC limit $offset,$limit"; $exe_sel=mysql_query($query_sel) or die(mysql_error()); ?><?php while($list=mysql_fetch_object($exe_sel)) { if($slno%2=='1') { $bg="#CEC3AD"; } else { $bg="#EDD9B1"; } $id=$list->eco_id; $headlines=stripslashes(preg_replace('~\s{2,}~','',$list->heading));//$list->spotlight_heading; ?> <tr bgcolor="<?php echo $bg;?>"> <td height="25" class="listitem" align="center" ><?php echo $slno;?></td> <td class="listitem" > <?php echo substr($headlines,0,240); ?></td> <td class="listitem" align="center" ><?php showStatus('knews_ticker','eco_id','status',$id); //showStatus(table name,idfield,status field, id)?></td> <td align="center"><a href="main.php?content=Edit_Ticker&id=<?php echo $id;?>"><img src="../images/edit.gif" border="0" title="Edit" /></a><input name="id" type="hidden" value="<?php echo $id;?>" /></td> <td align="center"><a href="delete_ticker.php?id=<?php echo $id;?>" onclick="return confirmSubmit()" ><img src="../images/delete.gif" border="0" title="Delete"></a></td> <?php $slno=$slno+1; } ?> </tr> <tr> <td colspan="6" height="15"></td> </tr> <tr> <td colspan="5" style="text-align:right;" height="25" bgcolor="#C2B59B"> <?php if($total>$limit) { $url="main.php?content=List_Ticker"; if ($total > $limit) { if($page>$total-5) { $c=$total-$page; $page1=$page+$c; } else { $page1=$page+5; } } if($page<6) { $d=6-$page; $s=5-$d; $page2=$page-$s; } else { $page2=$page-5; } if ($page == 1) // this is the first page - there is no previous page { // echo "Previous"; } else { // not the first page, link to the previous page echo "<a href=\"$url&page=1\"></a>"; echo " "; echo " "; echo "<a href=\"$url&page=" . ($page - 1) . "\" class=\"normaltext\">Previous</a>"; } if($page<6) { for ($i = 1; $i <= $pager->numPages; $i++) { echo " | "; if ($i == $page) echo "","$i"; else echo "<a href=\"$url&page=$i\" class=\"normaltext\">$i</a>"; } echo " | "; } else { for ($i = $page2; $i <= $page; $i++) { echo " | "; if ($i == $page) echo "$i"; else echo "<a href=\"$url&page=$i\">$i</a>"; } //// } if ($page == $pager->numPages) // this is the last page - there is no next page { echo ""; } else { // not the last page, link to the next page echo "<a href=\"$url&page=" . ($page + 1) . "\" class=\"normaltext\">Next</a>"; echo ""; echo "<a href=\"$url&page=".$total."\"></a>"; } }?> </td> </tr> <tr> <td colspan="5" style="text-align:right;" height="25" > </td> </tr> <?php }?> </table>
×
×
  • 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.