[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Emails/ -> Choose.php (source)

   1  <?php
   2  /*********************************************************************************
   3  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
   4   * ("License"); You may not use this file except in compliance with the License
   5   * The Original Code is:  vtiger CRM Open Source
   6   * The Initial Developer of the Original Code is vtiger.
   7   * Portions created by vtiger are Copyright (C) vtiger.
   8   * All Rights Reserved.
   9  *
  10   ********************************************************************************/
  11  
  12  require_once ('include/database/PearDatabase.php');
  13  $idlist = $_POST['idlist'];
  14  $pmodule=$_REQUEST['return_module'];
  15  $ids=explode(';',$idlist);
  16  
  17  if ($pmodule=='Accounts')
  18  {
  19      $querystr="select fieldid,fieldlabel,columnname,tablename from vtiger_field where tabid=6 and uitype=13;"; 
  20  }
  21  elseif ($pmodule=='Contacts')
  22  {
  23      $querystr="select fieldid,fieldlabel,columnname from vtiger_field where tabid=4 and uitype=13;";
  24  }
  25  elseif ($pmodule=='Leads')
  26  {
  27      $querystr="select fieldid,fieldlabel,columnname from vtiger_field where tabid=7 and uitype=13;";
  28  }
  29  
  30  $result=$adb->query($querystr);
  31  $numrows = $adb->num_rows($result);
  32  
  33  ?>
  34  <form name="choosemails" action="post">
  35  <input type="hidden" name="emailids" value="">
  36  <h4>The following emails are available for the selected record. Please choose the ones you would like to use.</h4>
  37  <div align="center">
  38  <table cellpadding="0" cellspacing="0" border="0">
  39      <?php
  40      for ($i=0;$i<$numrows;$i++)
  41      {
  42          $temp=$adb->query_result($result,$i,'columnname');
  43          $temp1=br2nl($myfocus->column_fields[$temp]);
  44          echo '<tr><td>'.$adb->query_result($result,$i,'fieldlabel').' </td><td>&nbsp;&nbsp;&nbsp;<input name="emails'.$i.'" type="checkbox" title="Raju"></td><td>'.$temp1.'</tr>';
  45      }
  46      ?>
  47  
  48      <script language="javascript">
  49  	function passemail()
  50      {        
  51          y=new Array();
  52          <?php  
  53          foreach ($ids as $id_num => $id)
  54          {
  55              print "y.push(\"$id\" );";
  56          }
  57          $cnt=count($ids);
  58          print "idcount=$cnt;";
  59          ?>
  60          <?php 
  61          for ($x=0;$x<$numrows;$x++)
  62          {
  63              ?>
  64              if (document.choosemails.emails<?php echo $x;?>.checked)
  65              {
  66                  for (m=0;m<idcount;m++)
  67                  {
  68                      y[m]=y[m]+"@<?php echo $adb->query_result($result,$x,'fieldid');?>";
  69                  }
  70              }
  71              <?php 
  72          } 
  73          ?>
  74          stry = y.join("");
  75          document.choosemails.emailids.value=stry;
  76          document.choosemails.submit();
  77      }
  78      </script>
  79  
  80  </table>
  81  <input type="button" name="OK" onClick="passemail()" value="OK">
  82  </div>
  83  </form>


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7