PHP Classes

File: fwphp/01mater/fw_popel_onb12/z_read_tbl.php

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/01mater/fw_popel_onb12/z_read_tbl.php  >  Download  
File: fwphp/01mater/fw_popel_onb12/z_read_tbl.php
Role: Example script
Content type: text/plain
Description: Example script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change:
Date: 3 months ago
Size: 2,822 bytes


Class file image Download
// <!-- display table (was and r o w c r e frm) -->

B12phpfw\module\fw_popel_onb12 ;

B12phpfw\core\zinc\Config_allsites as utl; // init, setings, utils
use B12phpfw\core\zinc\Db_allsites as utldb ; // model (fns) for all tbls
use B12phpfw\dbadapter\fw_popel_onb12\Tbl_crud as Tbl_crud_waybill ; // model (fns) for song tbl


$rcount = Tbl_crud_waybill::rrcnt($tbl) ;
$cursor = Tbl_crud_waybill::rr($sellst='*', $qrywhere= "'1'='1'" // ORDER BY aname
, $binds=[], $other=['caller' => __FILE__ .' '.', ln '. __LINE__ ] ) ;

<div class="container">

  <b><span id="ajax_pgtitle_box">Adressess (Links) count : </span><?=$rcount?></b>
         <!--input type="submit" name="submit_add_song" value="Add row" /-->
    &nbsp;&nbsp;&nbsp;<a href="<?=$pp1->module_url.QS.'i/cc/'?>">Add row</a>

  &nbsp;&nbsp; <div style="display: inline;" >
    <button id="ajax_rcount_btn"
      Display rows count via jQuery Ajax in span id="ajax_rcount_box"
    <span id="ajax_rcount_box"></span>

  <!-- main content output : List of songs -->
  <div class="xxbox">
        <thead style="background-color: #ddd; font-weight: bold;">

//foreach ($songs as $song)
while ( $r = utldb::rrnext($cursor) and isset($r->id) ):
$id = utl::escp($r->id) ; //htmlspecialchars($r->id, ENT_QUOTES, 'UTF-8');
        <td><?php echo $id; ?></td>
        <td><?php if (isset($r->artist)) echo utl::escp($r->artist); ?></td>
        <td><?php if (isset($r->track)) echo utl::escp($r->track); ?></td>
            <?php if (isset($r->link)) { ?>
<a href="<?=utl::escp($r->link)?>">
            <?php } ?>
          <td><a href="<=$pp1->module_url . QS . 'i/dd/t/song/id/'.$id?>">Del</a></td>
          <=str_repeat('&nbsp;', 8 - strlen($id)) . $id ?>
           <a id="erase_row" class="btn btn-danger"
              onclick="var yes ; yes = jsmsgyn('Erase row <?=$id?>?','') ;
              if (yes == '1') { location.href= '<?=$pp1->module_url.QS.'i/dd/t/song/id/'.$id?>/'; }"
              title="Delete tbl row ID=<?=$id?>"
           ><b style="color: red">Del</b></a>
        <td><a href="<?=$pp1->module_url.QS.'i/uu/t/song/id/'.$id?>">Edit</a></td>
    <?php } endwhile; ?>

    <p>You are in View: <?=__FILE__?></p>

For more information send a message to info at phpclasses dot org.