Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by sasa

  1. remove end while 
    it's just remnark in pseudo code[code=php:0]<?php
    $row = mysql_fetch_array($result);	  
    while($row2 = mysql_fetch_array($result)){ ?>
    <tr id="<?php echo $row['statusid']?>" class="status">
    <td><?php echo $row['date']?></td>
    <td id="<?php echo$row['statusid']?>" style="text-align:left;" class="editStatus">
    <?php echo htmlspecialchars($row['statusTxt'], ENT_QUOTES)?></td>
    <td style="width:1%;">
    <form action="">
    <input type="image" src="img/cancel.png"  onclick="makeVariable('<?php echo $row['statusid']?>')" class="deleteRowButton"/>
    </form>
    </td>
    </tr>
    <?php $row = $row2;?>
    <?php
    }
    $row=$row2;
    ?>
    <tr id="<?php echo $row['statusid']?>" class="statusLast">
    <td><?php echo $row['date']?></td>
    <td id="<?php echo$row['statusid']?>" style="text-align:left;" class="editStatus">
    <?php echo htmlspecialchars($row['statusTxt'], ENT_QUOTES)?></td>
    <td style="width:1%;">
    <form action="">
    <input type="image" src="img/cancel.png"  onclick="makeVariable('<?php echo $row['statusid']?>')" class="deleteRowButton"/>
    </form>
    </td>
    </tr>
    
    <?php } ?>

    but i don't see any diferents for last row

  2. i see in another your post thet you want href wich start with 'CORPSEARCH.ENTITY_INFORMATION?'

    in that case use

    $patern ='/href="(CORPSEARCH\.ENTITY_INFORMATION\?[^"]*)"/';
    preg_match_all($patern, $text, $html);
    $url =$out[1][0]; 
    $sql="INSERT INTO links(cid, nlink)VALUES('','$url')";

  3. href="          - literaly

    (                  - start groupin

    [^"]*          - any caracter diferant that " zero or more time

    )                  - end gruping

    "                - end caracter

  4. <?php
    
    session_start();
    if(isset($_POST)){
        $_SESSION['leafshape']  = $_POST['select1'];
        $_SESSION['leafcolor']  = $_POST['select2'];
        $_SESSION['leafvein']   = $_POST['select3'];
        $_SESSION['leafmargin'] = $_POST['select4'];
    }
    $leafshape = $_SESSION['leafshape']; 
    $leafcolor = $_SESSION['leafcolor'];
    $leafvein = $_SESSION['leafvein']; 
    $leafmargin = $_SESSION['leafmargin']; 

  5. try

    $team_select  = "SELECT @rank := @rank + 1 AS 'rank',
                            t.team_id,
                            t.team_name, 
                            COUNT(r.league_match_result_id) AS 'matches_played',
                            SUM(IF(r.result='Win',1,0)) AS 'wins', 
                            SUM(IF(r.result='Loss',1,0)) AS 'losses',
                            SUM(IF(r.result='Draw',1,0)) AS 'draws',
                                    SUM(IF(r.result='Win',3,IF(r.result='DRAW',2,0))) AS `points`
                     FROM teams t
                     LEFT JOIN league_match_results r ON r.team_id = t.team_id
                     LEFT JOIN team_leagues tl ON tl.team_id = t.team_id
                     RIGHT JOIN league_matches m ON r.league_match_id = m.league_match_id
                     WHERE tl.league_id = :1
                     GROUP BY t.team_id
                     ORDER BY team_name";

    maybe is beter setup another table for points results an join it

    table points

    result points

    Win      3

    Lost      0

    Draw    2

  6. let S be start and E end point
    x is walls
    
    xxxxxxxxx
    xxx x xxx
    x x     x
    x x x E x
    xS   x xx
    x       x
    xxxxxxxxx
    
    replace S with 0
    xxxxxxxxx
    xxx x xxx
    x x     x
    x x x E x
    x0   x xx
    x       x
    xxxxxxxxx
    
    in places near 0 put 1
    xxxxxxxxx
    xxx x xxx
    x x     x
    x1x x E x
    x01  x xx
    x1      x
    xxxxxxxxx
    
    in places near 1 put 2
    xxxxxxxxx
    xxx x xxx
    x x     x
    x1x x E x
    x012 x xx
    x12     x
    xxxxxxxxx
    
    end so on until is frespaces or you replace E
    
    xxxxxxxxx
    xxx x xxx
    x x4567 x
    x1x3x7E x
    x0123x7xx
    x1234567x
    xxxxxxxxx
    
    if you get E start with it and go to any place with number is smaler then number E
    go to next smaler until number 0 (point S)
    
    reverse path

  7. change

    else if (isset($_POST['cmdSave'])) //Try to save items first.
        {
    $partidvar=trim($_POST['txtPartid']);
    $modelnumvar=trim(crProcmodelnum($_POST['txtModelnum']));
    $modelnumvar=strtoupper($modelnumvar);
    $_SESSION['modelnum']=$modelnumvar; //Save for form display.
    $modelnumcatvar=trim(crProcprodname($_POST['txtModelnumcat']));
    $newpartvar=$_POST['chkNewpart']; //from checkbox to mark part as NEW
    $prodcatvar=trim($_POST['cbxProdcat']);
    $prodnamevar=trim(crProcprodname($_POST['txtProdname']));
    $prodsubnamevar=trim(crProcprodname($_POST['txtProdsubname']));
    $footnotevar=$_POST['chkFootnote']+0;
    $newchkbrandarr=$_POST['chkBrand']; //Checkbox for each brand.
    $oldchkbrandarr=$_SESSION['oldchkbrandarr']; //Checkboxes before user changed them.
    $olddata=$_SESSION['olddata']; //Non-brand Fields strung together.
    $brandlist=$_SESSION['brandlist']; //List of brands displayed.
    
    crPrintarr('chkBrand raw',$_POST['chkBrand']); //DEBUG
    
    //Turn nulls in checkboxes to zeros.
    $cnt=count($newchkbrandarr);
    for ($j=0; $j<$cnt; $j++)
    	{
    	$newchkbrandarr[$j]=$newchkbrandarr[$j]+0;
    	} //for j
    $newdata=$partidvar.$modelnumvar.$prodcatvar.$prodnamevar.
             $prodsubnamevar.$newpartvar.$modelnumcatvar.$footnotevar.$modelnumcatvar;

    to

     else 	$footnotevar=$_POST['chkFootnote']+0;
    $newchkbrandarr=$_POST['chkBrand']; //Checkbox for each brand.
    $oldchkbrandarr=$_SESSION['oldchkbrandarr']; //Checkboxes before user changed them.
    $olddata=$_SESSION['olddata']; //Non-brand Fields strung together.
    $brandlist=$_SESSION['brandlist']; //List of brands displayed.
    
    //	crPrintarr('chkBrand raw',$_POST['chkBrand']); //DEBUG
    
    //Turn nulls in checkboxes to zeros.
    //$cnt=count($newchkbrandarr);
            $cnt = max(array_keys($newchkbrandarr));
    for ($j=0; $j<=$cnt; $j++)
    	{
    	//$newchkbrandarr[$j]=$newchkbrandarr[$j]+0;
                    if (!isset($newchkbrandarr[$j])) $newchkbrandarr[$j]=0;
    	} //for j
    $newdata=$partidvar.$modelnumvar.$prodcatvar.$prodnamevar.
             $prodsubnamevar.$newpartvar.$modelnumcatvar.$footnotevar.$modelnumcatvar;

  8. OK

    when you check rows 0, 1 and 5 in variable $newchkbrandarr is array(0 = >1, 1 => 1, 5 =>1) is it righr?

    after 1st for loop $newchkbrandarr is array(0 = >1, 1 => 1, 2 => 0, 5 =>1) is it right?

    in 2nd for loop you sum this array $cnt2 is 3

     

    can you explain what you want?

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