Jump to content

Deks

Members
  • Posts

    35
  • Joined

  • Last visited

Posts posted by Deks

  1. Hello,

     

    sorry i have forgot to put what is my purpose with it.

    I wanna replace all chars from begining of each word and make first letter upper.

    I now how to do it, just can't do it with croatian special chars.

     

    Thanks fro replies.

  2. Hello,

     

    i have small problem with replacing croatian letters. I am using jQuery, and

    am trying to replace croatian letters č,ć,š,đ,ž but dunno how to put this in regex.

     

    For now i have regex for all chars:

     

    $('#text').replace(/\b[a-z]/g, 'somechars' );

     

    Unfortunately it wont reconize croatian special letters.

     

    Thanks.

    Regards

  3. Hello,

     

    am using iframe and not div because i need to call stored procedure inside procedure (sql query inside sql query) and i think my database don't like it. So i used first procedure and sent results to another script which i call with iframe.

     

     

    Thanks

  4. Hello,

     

    am using iframe to show dynamic data gained from sql query. So i get to little problem. Height of content is not always same. Is there any way where iframe can change height based on iframe content?

     

    some code would be perfect.

     

    Thanks.

  5. Hello,

     

    i have one little problem and can't pass it. Problem is i need to call new sql query inside another query. Am trying to make accordion which will put result of first query($sql) like title and result of second query($sql2) like list of current item.

    All time am getting error :

     

    Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt, SQL state S1000 in SQLExecDirect in .....

     

    I know reasone is because i use query inside query so am trying to figure is there any way to bypass it or make it work.

     

    Example:

    $sql="EXECUTE _PROCEDURE1 '".$date."',''.$code.";
    $rs=odbc_exec($conn,$sql);
    
    if (!$rs){exit("Error in SQL");}
    
    while (odbc_fetch_row($rs)){		
    	$id_number=odbc_result($rs,"ID");
    	$name=odbc_result($rs,"NAME");
    	echo $id_number.' - '.$name;
    
    	$sql2="EXECUTE _PROCEDURE2 '".$id_number."',''.$name.";
    	$name=odbc_exec($conn,$sql2);
    
    		while(odbc_fetch_row($popust)){ 
    			$detail = odbc_result($sql2,"DETAILS");
    			$detail2 = odbc_result($sql2,"DETAILS2");
    			$detail3 = odbc_result($sql2,"DETAILS3");
    			echo $detail.' - '.$detail2.' - '.$detail3;
    }
    }
    
    

     

     

    I hope i explained it well.

     

    Thanks.

     

  6. Hello,

     

    i need for my project fullsize browser window. Is there any was to lock browser on his fullscreen so users cant use drag to move him?

     

    I know that i can open predefined window but how to lock his size on drag?

     

    window.open('test.php','mywindow','resizable=no,fullscreen=yes')

     

    Thanks.

  7. Hello,

     

    am using Jqgrid and Jquery for making my webpage. I have some problems with implementing jqGrid with jquery layouts. Problem is with resizing grid on browser window resize. Height is working correctly but problem is width. It is like grid width won't refresh sometime. Also if i close left pane grid doesn't recognize new width and it stay on old.

     

    To be short, i need grid width is 100% of window width.

     

    For my testing am using source code from http://www.trirand.com/blog/jqgrid/jqgrid.html# .

     

    I tried with

     

    setTimeout(function(){
    $('#' + gridId).jqGrid('setGridWidth',gridWidth);
    }, 500);

     

    but same things happens.

     

    My code for resizing grid:

    $resize = <<<RESIZE
    
    if (document.body && document.body.offsetWidth) {
    winHeight = document.body.offsetHeight;
    }
    if (document.compatMode=='CSS1Compat' && document.documentElement && document.documentElement.offsetWidth ) {
    winHeight = document.documentElement.offsetHeight;
    }
    if (window.innerWidth && window.innerHeight) {
    winHeight = window.innerHeight;
    }
    
    wHeight = winHeight - 90;
    $("#grid").jqGrid('setGridHeight',wHeight);
    
    
    
    jQuery(window).resize(function(){
    gridId = "grid";
    
    
    if (document.body && document.body.offsetWidth) {
    	winHeight = document.body.offsetHeight;
    	}
    if (document.compatMode=='CSS1Compat' && document.documentElement && document.documentElement.offsetWidth ) {
    	winHeight = document.documentElement.offsetHeight;
    	}
    if (window.innerWidth && window.innerHeight) {
    	winHeight = window.innerHeight;
    	}
    
    
    setTimeout(function(){
    gridId = "grid";
    gridWidth = $('#gbox_' + gridId).parent().width();
    $('#' + gridId).jqGrid('setGridWidth',gridWidth);
    }, 100);
    
    wHeight = winHeight - 90;
    if(wHeight < 110){
    	wHeight = 110;
    	$('#'+ gridId).jqGrid('setGridHeight',wHeight);
    }else{
    $('#'+ gridId).jqGrid('setGridHeight',wHeight);
    }
    
    
    })
    
    RESIZE;
    $grid->setJSCode($resize);

     

    Also in index.php am using

    jQuery(document).ready(function(){
    
    $('body').layout({
    	resizerClass: 'ui-state-default',
            east__onresize: function (pane, $Pane) {
                jQuery("#grid").jqGrid('setGridWidth',$Pane.innerWidth()-2);
    	}
    });
    
    
    
    });

     

     

    I hope someone have some experiannce and can help me.

    Thanks.

     

    Regards

     

     

  8. Hello,

     

    i wanna make browser resizable =  false at some point of resizing my browser window, is that possible?

    Here is code where i wanna implement it .

     

    winHeight = window.innerHeight;     //get innerHeight
    wHeight = winHeight - 90;                //reduce it to fit with grid
    
    $("#grid").jqGrid('setGridHeight',wHeight);
    
    jQuery(window).resize(function(){
    gridId = "grid";
    gridWidth = $('#gbox_' + gridId).parent().width();
    $('#' + gridId).jqGrid('setGridWidth',gridWidth);                  //resize width
    
    winHeight = window.innerHeight;
    wHeight = winHeight - 90;
    if(wHeight < 110){                                           
    	wHeight = 110;                     //stop resizing grid
    	$('#'+ gridId).jqGrid('setGridHeight',wHeight);		
    }else{
    $('#'+ gridId).jqGrid('setGridHeight',wHeight);                     //resize height
    }

     

    So i want that my browser can't be resizable to lower when he have, for example, width =360 and height =110.

     

    Any ideas?

     

    Thanks.

  9. Hi,

     

    here is my whole php code for TCPDF template.

     

    <?php
    
    require_once('../../php/tcpdf/config/lang/eng.php');
    require_once('../../php/tcpdf/tcpdf.php');
    //connection to database
    include "connect.php";    
    
    // create new PDF document
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    
    //set auto page breaks
    $pdf->SetAutoPageBreak(false, PDF_MARGIN_BOTTOM);
    
    // set document information
    
    //$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
    
    // set default header data
    //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 061', PDF_HEADER_STRING);
    
    // set header and footer fonts
    //$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
    //$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
    
    // remove default header/footer
    $pdf->setPrintHeader(false);
    $pdf->setPrintFooter(false);
    
    // set default monospaced font
    //$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
    
    //set margins
    //$pdf->SetMargins(0, PDF_MARGIN_LEFT, 0);
    //$pdf->SetMargins(20, PDF_MARGIN_TOP, 20);
    $pdf->SetMargins($left=0, $top=0, $right=0, $keepmargins=false);
    
    //set image scale factor
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    
    //set some language-dependent strings
    $pdf->setLanguageArray($l);
    
    // set font
    //$pdf->SetFont('helvetica', '', 10);
    
    //----------------------------------------------------------
    // add a page
    $pdf->AddPage('P', 'A5');
    //$pdf->Cell(0, 0, 'A5 PORTRAIT', 1, 1, 'C');
    
    //===========================================================
    
    $logo ='QR/APPlogo.png';
    $table = '<table width="285" border="0" cellpadding="0" cellspacing="10" align="center"><tr>';
    
    //counters 
    $count_td = 1;
    $count_page = 1;
    
    //retrieve data from database
    $result = mysql_query("SELECT * FROM custombtn");
    while($row = mysql_fetch_array($result)){
    
    	if($count_td == 4){               //after each 3 data start new row
    		$count_td = 1;
    		$table .= '</tr><tr>';
    	}
    
    	if($count_page == 10){      //after each 9 data new page need to be created and 10th data placed on new page--doesnt work
    		$count_page = 1;
    		$table .= '</tr></table><table width="285" border="0" cellpadding="0" cellspacing="10" align="center"><tr>';   
    		$pdf->AddPage('P', 'A5');
    	}
    
    	$table .= '<td width="95" align="center"><img src="QR/'.$row['name'].'.png"/>
    	<p style="font-family:Verdana, Geneva, sans-serif; font-size:15px">
    	Inv.br: <b style="font-size:40px;">'.$count_page.'</b></p>
    	<br><img width="90" height="29" src="'.$logo.'"/></td>';
    
    $count_td++;
    $count_page++;
    
    }
    
    $pdf->writeHTML($table, true, false, true, false, '');
    
    $pdf->lastPage();
    
    $pdf->Output('PDFTemplate.pdf', 'I');
    
    ?>
    

     

    I little adjust folders from before (put all to QR), it work when i dont put IF function for new page.

     

    So.. i tried with :

     

    if($count_page == 10){      //after each 9 data new page need to be created and 10th data placed on new page--doesnt work
    		$count_page = 1;
    		$table .= '</tr></table><table width="285" border="0" cellpadding="0" cellspacing="10" align="center"><tr>';   
    		$pdf->AddPage('P', 'A5');
    	}
    

     

    and also....

     

    if($count_page == 10){      //after each 9 data new page need to be created and 10th data placed on new page--doesnt work
    		$count_page = 1;
    		$table .= '</tr></table>';   
    		$pdf->AddPage('P', 'A5');
                            $table .='<table width="285" border="0" cellpadding="0" cellspacing="10" align="center"><tr>';
    	}
    

     

    but...no effects, code for creating new page after each 9 data  and placing next data to new page doesnt work.

     

    Sorry for bothering and thanks for helping.

     

    Regards

     

  10. Sorry for bothering but am stuck again. Am trying to put on each page 9 datas, but problem is that my <table> is in front of while function(i think thats main problem).

     

    $logo ='QRcodovi/APPlogo.png';
    
    $table = '<table border="0" cellpadding="0" cellspacing="10" align="center"><tr>';
    $count_td = 1;
    $count_page = 1;
    
    $result = mysql_query("SELECT * FROM custom");
    while($row = mysql_fetch_array($result)){
    
    	if($count_td == 4){
    		$count_td = 1;
    		$table .= '</tr><tr>';
    	}
    	if($count_page == 10){     //after each 9 data new page need to be created and 10th data placed on new page
    		$count_page = 1;
    		$pdf->AddPage('P', 'A5');
    
    	}
    
    	$table .= '<td align="center"><img src="QR/'.$row['name'].'.png"/>
    	<p style="font-family:Verdana, Geneva, sans-serif; font-size:15px">
    	Inv.br: <b style="font-size:40px;">'.$count_page.'</b></p>    // testing counter
    	<br><img width="90" height="29" src="'.$logo.'"/></td>';
    
    $count_td++;
    $count_page++;
    
    }
    
    $pdf->writeHTML($table, true, false, true, false, '');

     

    Can it be solved on this way?

     

    Thanks.

     

  11. Well i make this is PHP :

     

    $logo ='QRcodovi/APPlogo.png';
    
    echo '<table border="1" align="center"><tr>';
    $count = 1;
    
    $result = mysql_query("SELECT * FROM custom");
    while($row = mysql_fetch_array($result)){
    
    if($count == 4){
    $count = 1;
    echo '</tr><tr>';
    
    }
    
    echo '<td align="center"><img src="QR/'.$row['name'].'.png"/>
    	<p style="font-family:Verdana, Geneva, sans-serif; font-size:15px">
    	Inv.br: <b style="font-size:40px;">'.$row['name'].'</b></p>
    	<br><img width="90" height="29" src="'.$logo.'"/></td>';
    
    $count++;
    
    }

     

    But am not sure how to use it in TCPDF with using

    $pdf->writeHTML($string, true, false, true, false, '');

     

    Any idea?

  12. Yes. I tasted him :)

     

    But i also know that he wont do something in html if tags are not closed. In your example u dont close table? Its like auto close?

     

    BTW if you are familiar with TCPDF can u advice me what command should i use for writing html. WriteHTMLCell, WriteHTML or some other maybe?

     

     

    Thanks.

  13. Hello,

     

    can someone help me with my proggraming problem please. Am new in this so i still have lots problems.

     

    I need to put all data from my MySQL table in one table in html.

    There is catch... i need to design output to give me table with x rows and 3 columns, so it means while reading data from database it need put every 4th in new row. And if there  isnt 3 data (or better say if there isnt 3 full <td>)  in row code will automatically add empty <td> or 2 in table.

     

    So...did somebody do this before or have some code ?

     

    All i got for now is  :(

     

    $td ='<td align="center"><img src="'.$row['name'].'.png" />
    	<p style="font-family:Verdana, Geneva, sans-serif; font-size:15px">
    	Number: <b style="font-size:40px;">'.$row['serial'].'</b></p>
    	<br><img width="90" height="29" src="'.$logo.'"/></td>';
    
    $tr ='<tr>'.$td.'</tr>';
    
    $html='<table border="1" align="center">'.$tr.'</table>';

     

    Thanks.

     

     

×
×
  • 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.