Location: PHPKode > projects > MembersGear > membersgear/admin/admin_users_v.php
<?php
  
  require_once "../config/config.php"; 
  require_once INCLUDE_DIR."/users_class.php";
  $users=new users_class();
  $lsmanageuser=true;  
    
  if(isset($_SESSION[SESSION_PREFIX.'page_referrer']))
      unset($_SESSION[SESSION_PREFIX.'page_referrer']);
      
  if($users->IsAdminhavePermission($_SESSION[SESSION_PREFIX.'Admin_UserID'],'Can browse user profiles')==false)
  {
    Redirect('admin_nopermission.php',true);  
      
  }  
  if($users->IsAdminhavePermission($_SESSION[SESSION_PREFIX.'Admin_UserID'],'Can delete users')==false) 
  {
  
    $lsmanageuser=false;
  }      
  
  
  switch($_action)
  {
      
       case 'insert':   
       
       
       case 'update':  
       
        default:       
           ////Parameterized View
         /*  $lsValues = array();
           
           $lTypes=null;
           
           $result = $loManageFields->View('SELECT * FROM '.TABLE_PREFIX.'singupformfields');
  
           $smarty->assign('data',$result);
           
           //$smarty->display('admin_fields_m.tpl');  */
          // require_once "../templates/admin_header.php";
         
         //for display the header.php  
         
         $quest="&";
                if(isset($_GET) && !empty($_GET))
                 {
                     foreach($_GET as $keyname => $value) {
                          $quest.=$keyname."=".$value."&";
                        }     
                 
                 }
           echo($smarty->fetch('admin_header.php'));
           echo "<form name=\"frmDeleteLog\" action=\"admin_users_m.php?action=delete_selected$quest\" method=\"POST\">"; 
           echo "<div id=\"content\" class=\"setdiv\"> ";
             echo "
                    <script language=\"JavaScript\">
                        function CheckAll(elementID)
                        {
                            var CheckSelect = document.getElementById('chkSelectAll');
                            var LabelCheckSelect = document.getElementById('lblSelect');
                            var AllCheckBox = document.getElementsByName('chkDeleteItem[]');
                            //alert(CheckSelect.checked);
                            //alert(AllCheckBox.length);
                            
                            switch(elementID)
                            {
                                case 'chkSelectAll':
                                        if(CheckSelect.checked)
                                        {
                                             //alert(AllCheckBox.length);
                                             LabelCheckSelect.innerHTML = 'Uncheck All';
                                            for(i=0;i<AllCheckBox.length;i++)
                                            {
                                                AllCheckBox[i].checked = 'true';
                                            }
                                        }
                                        else
                                        {
                                            LabelCheckSelect.innerHTML = 'Check All';
                                            for(i=0;i<AllCheckBox.length;i++)
                                            {
                                                AllCheckBox[i].checked = '';
                                            }
                                        }
                                        break;
                                case 'ckhDeleteItem':
                                        var flag = 1;
                                        for(i=0;i<AllCheckBox.length;i++)
                                        {
                                            if(!AllCheckBox[i].checked)
                                            {
                                                  flag = 0;
                                            }
                                        }
                                        
                                        if(flag == 0)
                                        {
                                             LabelCheckSelect.innerHTML = 'Check All';
                                             CheckSelect.checked = '';
                                        }
                                        else
                                        {
                                             LabelCheckSelect.innerHTML = 'Uncheck All';
                                             CheckSelect.checked = 'true';
                                        }
                            }
            
                        }
                        
                        function ValidateCheckbox(str,str1)
                        {
                              var AllCheckBox = document.getElementsByName('chkDeleteItem[]');
                              //alert(str1);   
                              var flag = 0;  
                                for(i=0;i<AllCheckBox.length;i++)
                                {
                                        if(AllCheckBox[i].checked)
                                        {
                                                  flag = 1;
                                        }
                                }
                                
                                if(flag == 0 && str == 'selected')
                                {
                                    if(str1=='btnEmailSelected')
                                    {
                                        alert('Please select atleast one record to send a Email');
                                    }
                                    else if(str1=='btnDeleteSelected')
                                    {
                                        alert('Please select atleast one record to delete!'); 
                                    }
                                    return false;
                                }
                                else
                                {   if(str1=='btnDeleteSelected')
                                    {
                                        return confirm('Are you sure to delete '+str+' users?');
                                    }
                                    else
                                    {
                                        return true;
                                    }
                                    //return true;
                                } 
                                
                        }
                        function Formsubmit()
                        {              
                            document.frmDeleteLog.action='admin_send_email.php?action=senduser'; 
                            document.frmDeleteLog.submit();
                        }
                    </script>
                
                 ";
           if($message->IsMessageExists())
           {    
                $lsmsg=$message->GetMessage();
                echo "<div class=\"succmsg\" style=\"width:400px\">$lsmsg</div>";
           }
            echo "<div id=\"full-contentdiv\">"; 
           
            echo "<div class=\"righttop\">";
            echo "<h2 align=\"center\">";
            echo "Manage Members";
            echo "</h2>";
            echo "</div>";
            echo "<div class=\"whole-page clear\">";
           
            /****************************************************************************
            * Updated By Jayesh : for display character based paging
            *****************************************************************************/
             echo "<div style=\"text-align:center;margin:2px;\">";
            echo "<div style=\"margin-left:3px;margin-top:3px;text-align:left;font-weight:bold !important;float:left;width:120px;\">";
           // if($lsmanageemaillog==true)
            {
               echo "<input type=\"checkbox\" class=\"chkcss\" id=\"chkSelectAll\" name=\"chkSelectAll\" onclick=\"return CheckAll(this.id)\"> <label id=\"lblSelect\" for=\"chkSelectAll\">Check All</label>";              
            }
              echo "</div>";
            //echo "<div style=\"width:56%;text-align:center;margin:2px;padding-left:215px\">";
            //echo "<div class=\"float: left;margin-left:110px\">";  
            echo "<div class=\"divABCDPaging\">";
            echo PrintABCDPaging();
            echo "</div>";                     
            echo "</div>";
            if(isset($_GET['letter']) and $_GET['letter'] != 'all')
              {
                    $lsSearchLetter = $_GET['letter'];
              }
              else
              {
                    $lsSearchLetter = '';   
              }
            /****************************************************************************/
            
               /* $sql="select   u.id as id,u.username as username,u.Email as email,
                     (SELECT mv.value  FROM 
                     ".TABLE_PREFIX."master_values mv join ".TABLE_PREFIX."master m on m.id = mv.masterID where
                             m.Name = 'userstatus' and   mv.id =`status`) as status,CONCAT(firstname, ' ',                               lastname) as usrefullname,' ' as payment, 
                             ur.roleid as role  from  ".TABLE_PREFIX."users u join
                              ".TABLE_PREFIX."users_in_roles ur on u.id=ur.userid and
                             ur.roleid =(select id from  ".TABLE_PREFIX."roles where name='customer')
                      group by u.id"; */
                  /*
                  $sql="select   u.id as id,u.username as username,concat('<a href=\"mailto:',u.Email,'\">',u.Email,'</a>') as email,
                       (CASE WHEN  u.isapproved=1 THEN 'Yes' else 'NO' END) as isapproved,
                       (CASE u.islockedout WHEN 0 THEN 'No' WHEN 1 THEN 'Yes' WHEN 2 THEN 'Disable auto-lock' ELSE '' END) as islockedout,
                       (CASE WHEN u.isapproved=1 and u.islockedout=0 THEN 'Active' ELSE 'Inactive' END)
                      as status,CONCAT(firstname, ' ',lastname) as usrefullname,' ' as payment, 
                             ur.roleid as role  from  ".TABLE_PREFIX."users u join
                              ".TABLE_PREFIX."users_in_roles ur on u.id=ur.userid and
                             ur.roleid =(select id from  ".TABLE_PREFIX."roles where name='customer') where username like ('".$lsSearchLetter."%')
                      group by u.id"; 
                  */
                 /* $sql="select   u.id as id,u.username as username,concat('<a href=\"mailto:',u.Email,'\">',u.Email,'</a>') as email,
                       (CASE WHEN  u.isapproved=1 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Yes','</td></tr></table>') else concat('<table                           width=\"100%\"><tr><td align=\"center\">','No','</td></tr></table>') END) as isapproved,
                       (CASE u.islockedout WHEN 0 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','No','</td></tr></table>') 
                        WHEN 1 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Yes','</td></tr></table>')
                        WHEN 2 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Disable auto-lock','</td></tr></table>')
                        ELSE '' END) as islockedout,
                       (CASE WHEN u.isapproved=1 and u.islockedout=0 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Active','</td></tr></table>')                         ELSE concat('<table width=\"100%\"><tr><td align=\"center\">','Inactive','</td></tr></table>') END) as status,
                        CONCAT(firstname, ' ',lastname) as usrefullname,' ' as payment, ur.roleid as role  
                        from ".TABLE_PREFIX."users u 
                        join ".TABLE_PREFIX."users_in_roles ur on u.id=ur.userid and ur.roleid =(select id from  ".TABLE_PREFIX."roles where name='customer')                             where username like ('".$lsSearchLetter."%') group by u.id";  */
                # execute the sql query
              /*  $sql="select id,cast(GROUP_CONCAT( concat(ProductStatusCount,'-',products) separator '<br />') as char(500)) ProductMembershipStatus,
                      username,email,isapproved,islockedout,status,userfullname,payment,role,productid,userpaymentsubscription,actionlink,AccessLog1,loginas
                      from
                      (
                        select  u.id as id,CONCAT(u.firstname, ' ',u.lastname) as userfullname,count(tpu.productmembershipstatusid) ProductStatusCount,
                          (SELECT mv.value  FROM
                           ".TABLE_PREFIX."master_values mv join ".TABLE_PREFIX."master m on m.id = mv.masterID where
                           m.Name = 'productmembershipstatus' and   mv.id =`productmembershipstatusid`)as
                           products,productid,
                           u.username as username,
                           concat('<a href=\"mailto:',u.Email,'\">',u.Email,'</a>') as email,
                           (CASE WHEN  u.isapproved=1 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Yes','</td></tr></table>') else concat('<table width=\"100%\"><tr><td align=\"center\">','No','</td></tr></table>') END) as isapproved,
                           (CASE u.islockedout WHEN 0 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','No','</td></tr></table>')
                            WHEN 1 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Yes','</td></tr></table>')
                            WHEN 2 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Disable auto-lock','</td></tr></table>')
                            ELSE '' END
                            ) as islockedout,
                           (CASE WHEN u.isapproved=1 and u.islockedout=0 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Active','</td></tr></table>')ELSE concat('<table width=\"100%\"><tr><td align=\"center\">','Inactive','</td></tr></table>') END) as status,
                           (SELECT concat('$',FORMAT(sum(price),2)) from ".TABLE_PREFIX."products where id 
                                in( select productid from ".TABLE_PREFIX."product_users where userid=tpu.userid and productmembershipstatusid!= (SELECT mv.id FROM
                                    ".TABLE_PREFIX."master_values mv join ".TABLE_PREFIX."master m on m.id = mv.masterID where
                                    m.Name = 'productmembershipstatus' and   mv.`value`='pending')
                                    )
                           ) as payment,
                            ur.roleid as role,
                            concat('<a href=\"admin_user_subscription_v.php?userid=',u.id,'\"><img src=\"images/a_download.gif\" title=\"User Payment Subscription\" alt=\"User Payment Subscription\"></a>') as `userpaymentsubscription`,
                            concat('<a href=\"admin_user_action.php?userid=',u.id,'\"><img src=\"images/a_download.gif\" title=\"Action\" alt=\"Action\"></a>') as `actionlink`,
                            concat('<a href=\"admin_user_accesslog.php?userid=',u.id,'\"><img src=\"images/a_download.gif\" title=\"Access Log\" alt=\"Access Log\"></a>') as `AccessLog1`,
                            concat('<a href=\"../user_login.php?userid=',u.id,'\"><img src=\"images/a_download.gif\" title=\"Loginas\" alt=\"Loginas\"></a>') as `loginas` 
                            from ".TABLE_PREFIX."users u
                            join ".TABLE_PREFIX."users_in_roles ur on u.id=ur.userid and ur.roleid =(select id from  ".TABLE_PREFIX."roles where name='customer') left join
                            ".TABLE_PREFIX."product_users tpu on u.id=tpu.userid
                            group by u.id,tpu.userid,productmembershipstatusid
                      ) a   group by username,email,isapproved,islockedout,status,userfullname,payment,role
                            order by userfullname,1 desc";   */
           /*               $sql="select CheckToDelete,createon,productid,payment,id,cast(GROUP_CONCAT( concat(ProductStatusCount,'-',products) separator '<br />') as char(500)) ProductMembershipStatus,
                      username,email,isapproved,islockedout,status,userfullname,role,userpaymentsubscription,actionlink,AccessLog1,loginas,`LastLoginTime`
                      
                      from
                      (
                        select u.id as `userid`, concat('<input type=\"checkbox\" id=\"ckhDeleteItem\" name=\"chkDeleteItem[]\" onclick=\"return CheckAll(this.id)\" value=\"',u.id,'\" />') as `CheckToDelete`, 
                        concat('<span style=\"display:none;\">',from_unixtime(u.createdon),'</span>',date_format(from_unixtime(u.createdon),\"%d %b, %Y\")) as `createon`, 
                        productid,u.id as id,CONCAT(u.firstname, ' ',u.lastname) as userfullname,count(tpu.productmembershipstatusid) ProductStatusCount,
                          case when pmvp.value = 'Expire' then
       concat('<span style=\"color:red;font-weight:bold\">',pmvp.value,'</span>')
      when pmvp.value = 'Active' then
        concat('<span style=\"font-weight:bold\">',pmvp.value,'</span>')
      when pmvp.value = 'Pending' or pmvp.value ='Inactive' then pmvp.value end as  products,
                           u.username as username,
                           (case when LENGTH(u.Email) >= 15 then concat('<a href=\"mailto:',u.Email,'\">',concat(SUBSTR(u.Email,1,15),'...'),'</a>') else concat('<a href=\"mailto:',u.Email,'\">',u.Email,'</a>') end) as email,
                           (CASE WHEN  u.isapproved=1 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Yes','</td></tr></table>') else concat('<table width=\"100%\"><tr><td align=\"center\">','No','</td></tr></table>') END) as isapproved,
                           (CASE u.islockedout WHEN 0 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','No','</td></tr></table>')
                            WHEN 1 THEN concat('<table width=\"100%\"><tr><td align=\"center\"><font color=\"red\"><b>','Yes','</b></font></td></tr></table>')
                            WHEN 2 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Disable auto-lock','</td></tr></table>')
                            ELSE '' END
                            ) as islockedout,
                           (CASE WHEN u.isapproved=1 and u.islockedout=0 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Active','</td></tr></table>')ELSE concat('<table width=\"100%\"><tr><td align=\"center\">','Inactive','</td></tr></table>') END) as status,
                           (SELECT replace(FORMAT(sum(amount),2),',','') as payment
   from ".TABLE_PREFIX."product_users   where   userid=tpu.userid  and productmembershipstatusid  in (SELECT mv.id  FROM
                           ".TABLE_PREFIX."master_values mv join ".TABLE_PREFIX."master m on m.id = mv.masterID where
                           m.Name = 'productmembershipstatus' and  mv.value!='Pending'
                          )) as payment,
                            ur.roleid as role,
                            concat('<a href=\"admin_user_subscription_v.php?userid=',u.id,'\"><img src=\"images/payment.gif\" title=\"User Payment Subscription\" alt=\"User Payment Subscription\"></a>') as `userpaymentsubscription`,
                            concat('<a href=\"admin_user_action.php?userid=',u.id,'\"><img src=\"images/action.gif\" title=\"Action\" alt=\"Action\"></a>') as `actionlink`,
                            concat('<a href=\"admin_user_log_v.php?userid=',u.id,'\"><img src=\"images/accesslog.gif\" title=\"Access Log\" alt=\"Access Log\"></a>') as `AccessLog1`,
                            (case when (u.isapproved=0 and islockedout=0) or  (u.isapproved=0 and islockedout=1) or (u.isapproved=1 and islockedout=1) or (u.isapproved=0 and islockedout=2)  then
                              concat('<img src=\"images/logindiable.gif\" title=\"Loginas\" alt=\"Loginas\">')
                            else
                                concat('<a href=\"../user_login.php?action=dologin&username=',username,'&useremail=',email,'\" target=\"_blank\"><img src=\"images/login.gif\" title=\"Loginas\" alt=\"Loginas\"></a>')
                            end) as `loginas`, IFNULL((from_unixtime(`last_login_date`,'%M %d, %Y %h:%i:%S %p')),'Never') as 'LastLoginTime'
                          
                           from ".TABLE_PREFIX."users u
                            join ".TABLE_PREFIX."users_in_roles ur on u.id=ur.userid and ur.roleid =(select id from  ".TABLE_PREFIX."roles where name='customer') left join
                            ".TABLE_PREFIX."product_users tpu on u.id=tpu.userid
                            left join ".TABLE_PREFIX."master_values pmvp on pmvp.id = tpu.productmembershipstatusid
                            group by u.id,tpu.userid,productmembershipstatusid
                      ) a   where username like ('".$lsSearchLetter."%') group by username,email,isapproved,islockedout,status,userfullname,payment,role
                            order by userfullname,1 desc";     */
                            
                            
                 $sql="SELECT distinct u.id,concat('<input type=\"checkbox\" id=\"ckhDeleteItem\" name=\"chkDeleteItem[]\" onclick=\"return CheckAll(this.id)\" value=\"',u.id,'\" />') as `CheckToDelete`, username, concat(firstname, ' ',lastname) as userfullname,
                        (case when LENGTH(u.Email) >= 15 then concat('<a href=\"mailto:',u.Email,'\">',concat(SUBSTR(u.Email,1,15),'...'),'</a>') else concat('<a href=\"mailto:',u.Email,'\">',u.Email,'</a>') end) as email,
                        concat('<div id=\"payment-',u.id,'\"','name=\"payment[]\"', '>','<center><img',' id=\"payment-load',u.id,'\"' ,'src=\"images/loading1.gif\"></center></div>') as payment,
                        concat('<div id=\"products-',u.id,'\">','<center><img',' id=\"products-load',u.id,'\"' , 'src=\"images/loading1.gif\"></center></div>') as products,
                        concat('<span style=\"display:none;\">',from_unixtime(u.createdon),'</span>',date_format(from_unixtime(u.createdon),\"%d %b, %Y\")) as `createon`, 
                        (CASE WHEN  u.isapproved=1 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Yes','</td></tr></table>') else concat('<table width=\"100%\"><tr><td align=\"center\">','No','</td></tr></table>') END) as isapproved,
                        (CASE u.islockedout WHEN 0 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','No','</td></tr></table>')
                                                WHEN 1 THEN concat('<table width=\"100%\"><tr><td align=\"center\"><font color=\"red\"><b>','Yes','</b></font></td></tr></table>')
                                                WHEN 2 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Disable auto-lock','</td></tr></table>')
                                                ELSE '' END
                                                ) as islockedout,

                        (CASE WHEN u.isapproved=1 and u.islockedout=0 THEN concat('<table width=\"100%\"><tr><td align=\"center\">','Active','</td></tr></table>')ELSE concat('<table width=\"100%\"><tr><td align=\"center\">','Inactive','</td></tr></table>') END) as status,

                        concat('<a href=\"admin_user_subscription_v.php?userid=',u.id,'\"><img src=\"images/payment.gif\" title=\"User Payment Subscription\" alt=\"User Payment Subscription\"></a>') as `userpaymentsubscription`,
                        concat('<a href=\"admin_user_action.php?userid=',u.id,'\"><img src=\"images/action.gif\" title=\"Action\" alt=\"Action\"></a>') as `actionlink`,
                        concat('<a href=\"admin_user_log_v.php?userid=',u.id,'\"><img src=\"images/accesslog.gif\" title=\"Access Log\" alt=\"Access Log\"></a>') as `AccessLog1`,
                        (case when (u.isapproved=0 and islockedout=0) or  (u.isapproved=0 and islockedout=1) or (u.isapproved=1 and islockedout=1) or (u.isapproved=0 and islockedout=2)  then
                        concat('<img src=\"images/logindiable.gif\" title=\"Loginas\" alt=\"Loginas\">')
                        else
                        concat('<a href=\"../user_login.php?action=dologin&username=',username,'&useremail=',email,'\" target=\"_blank\"><img src=\"images/login.gif\" title=\"Loginas\" alt=\"Loginas\"></a>')
                        end) as `loginas`,
                        IFNULL((from_unixtime(`last_login_date`,'%M %d, %Y %h:%i:%S %p')),'Never') as 'LastLoginTime'

                    FROM  ".TABLE_PREFIX."users u 
                    join  ".TABLE_PREFIX."users_in_roles ur on ur.userid = u.id and ur.roleid =(select id from  ".TABLE_PREFIX."roles where name='customer')  
                    where username like ('".$lsSearchLetter."%') ";           
                               
                
                 $db->execute($sql);  
          
                 $totalrowcount=$db->rowCount();
                # creates a new phpSortColumn object for ID´s 
                //$col_0 = new phpSortColumn("id", "ID");
                
                #creates a new phpSortcolunm objects for name
                $col_0 = new phpSortColumn("CheckToDelete", ""); 
                $col_1 = new phpSortColumn("username", "Login");
                
                 $col_2 = new phpSortColumn("userfullname", "Name"); 
                
                # creates a new phpSortColumn object for Tile
                $col_3 = new phpSortColumn("email", "Email");

                # creates a new phpSortColumn object for Field Type
                $col_4 = new phpSortColumn("payment", "Payment(\$)");

                # creates a new phpSortColumn object for Desplay Type   
                $col_5 = new phpSortColumn("products", "Membership");
                
                
                $col_6=new  phpSortColumn("createon", "Member Since"); 
                
                $col_7 = new phpSortColumn("isapproved", "Approved");  
                
                $col_8 = new phpSortColumn("islockedout", "Lockedout");
                
                $col_9 = new phpSortColumn("LastLoginTime", "Last Login");
                
                $col_10 = new phpSortColumn("userpaymentsubscription","");
                 
                $col_11 = new phpSortColumn("actionlink", "");
                  
                $col_12 = new phpSortColumn("AccessLog1", "");
                   
                $col_13 = new phpSortColumn("loginas", "");
                
                  

                # creates a new phpSortColumn object for validation function   
               
                 
                # add the columns to an array 
                $columns = array(0=>$col_0, 1=>$col_1, 2=>$col_2, 3=>$col_3,4=>$col_4,5=>$col_5,6=>$col_6,7=>$col_7,8=>$col_8,9=>$col_9,10=>$col_10,11=>$col_11,12=>$col_12,13=>$col_13);

                # create a new phpSortable object with the abstracted db object
                # and the array of column object
                $sortable = new phpSortable($db, $columns);

                # define the table format: cellpadding, cellspacing, border
                $sortable->setTableFormat ("2", "2", "0");

                # define the table title
                $sortable->tableTitle = "";

                # Encrypt Edit and Delete Link
                $sortable->encryptlink = false;
                
                # define the link for edit of entries
                $sortable->editLink = "admin_users_m.php?action=edit";

                # open the edit page in a new window
                //$sortable->editTarget = "_blank";

                # window format for the edit page
               // $sortable->editWindowFormat = "'width=300,height=400'";

                # define the link for delete of entries
                $quest="&";
                if(isset($_GET) && !empty($_GET))
                 {
                     foreach($_GET as $keyname => $value) {
                          $quest.=$keyname."=".$value."&";
                        }     
                 
                 }
                $sortable->deleteLink = "admin_users_m.php?action=delete$quest";

                # define the link for add new entries
                $sortable->addLink = "admin_users_m.php";
                
                # set visibility of add,edit,delete link of the grid
                if($users->IsAdminhavePermission($_SESSION[SESSION_PREFIX.'Admin_UserID'],'Can add users')==false)
                {
                    $sortable->showaddLink=false; 
                }
                if($users->IsAdminhavePermission($_SESSION[SESSION_PREFIX.'Admin_UserID'],'Can edit users')==false)
                {
                    $sortable->showeditLink=false; 
                    
                }
            
                if($lsmanageuser==false)
                {
                    $sortable->showdeleteLink=false;  
                
                }

                # define the hint to be displyed over the add button
                $sortable->addText = "Add New User";

                # define the key name to be attached to links
                $sortable->urlKeyName = "id";

                # define the column name of to be attached to links as key value
                $sortable->tableKeyName = "id";

                # define the prompt message to be diplayed on clicking the edit button            
                //$sortable->editPromptMsg = "Are you sure you want to edit this affiliate?";

                # define the prompt message to be diplayed on clicking the delete button
                $sortable->deletePromptMsg = "Are you sure you want to delete this User?";

                # define the message to be diplayed if there are no results found
                $sortable->emptyMsg = "No User found.";

                #define the deafult row number to be displayed
                $sortable->defaultRowsNum = "10";

                #define the path for the css file
                $sortable->cssFilePath = ADMIN_CSS_DIR."/phpSortable.css";

                #define the path for of the images directory
                $sortable->imgFilePath = ADMIN_IMAGE_DIR."/phpgrid/";

                # print the table            
                $sortable->printTable();
                if($totalrowcount>0)
                {
                   if($lsmanageuser==true)
                   {  
                     echo '<input style="margin:5px;" type="submit" value="Delete Selected Users" name="btnDeleteSelected" id="btnDeleteSelected" class="btncss" onclick="return ValidateCheckbox(\'selected\',this.id);"/>';
                   }
                    echo '<input style="margin:5px;" type="submit" value="Send Email to Selected Users " name="btnEmailSelected" id="btnEmailSelected" class="btncss" onclick="var result=ValidateCheckbox(\'selected\',this.id); if(result==true){Formsubmit();}else{return false;}"/>';
                } 
               if($totalrowcount<=0 )
               {
                 echo "<script>";
                 echo "document.getElementById('chkSelectAll').style.display='none';";
                echo "document.getElementById('lblSelect').style.display='none';";
                 //echo "document.getElementById('btnDeleteSelected').style.display='none';";
                 //echo "document.getElementById('btnDeleteAll').style.display='none';";
                // echo "document.getElementById('btnEmailSelected').style.display='none';";  
                 echo "</script>";
               }
              echo "</div>";
              echo "</div>";
              echo "</div>";
              echo "</form>";   
              //For display footer.php
              
  ?>
 <!-- <script language="javascript" type="text/javascript">     
     var $j = jQuery.noConflict();  
           
     $j(document).ready(function(){  
             var allrecs=$j("div[name='payment[]']") ;
               allrecs.each(function (i,domEle) {   
               var htmlId=domEle.id;
               splitRec=htmlId.split('-');
               var userId=splitRec[1];
     
                   var dataString="userId=" + userId;
                   $j.ajax({
                           type: "POST",
                           url: "<?php echo WEB_URL; ?>"+"/admin/admin_user_grid_get_payment_info.php",
                           datatype: 'html',
                           type: 'POST',
                           data: dataString,
                           success: function(msg){
                               msg=ltrim(rtrim(msg));
                                
                              var rtn=msg.split('|||');
                              $j("#payment-"+userId).html(rtn[1]);
                              $j("#products-"+userId).html(rtn[0]);
                              
                           }
                       });  
               
               
              });

      
          
      
      });   
    </script>  -->
    
    
    <script language="javascript" type="text/javascript">     
     var $j = jQuery.noConflict();  
     var dataString="userId=("      
     $j(document).ready(function(){  
              var allrecs=$j("div[name='payment[]']") ;
              var AllrecLen=allrecs.length;
              AllrecLen= Number(AllrecLen)-1;
               
              allrecs.each(function (i,domEle) {   
                       var htmlId=domEle.id;
                       splitRec=htmlId.split('-');
                       var userId=splitRec[1];
                       dataString=dataString + userId ;
                       if(AllrecLen!=i)
                          dataString=dataString + ",";  
                       
                 });  
                
                 dataString= dataString + ")"; 
                   
                   $j.ajax({
                           url: "<?php echo WEB_URL; ?>"+"/admin/admin_user_grid_get_payment_info.php",
                           datatype: 'html',
                           type: 'POST',
                           data: dataString,
                           success: function(msg){
                            if(msg!=''){
                                   
                                   dataarr = msg.split('|||');  
                                    $j.each(
                                        dataarr,
                                         function( intIndex, objValue ){
                                         
                                          allrecs.each(function (i,domEle) {   
                                                   var htmlId=domEle.id;
                                                   splitRec=htmlId.split('-');
                                                   var userId=splitRec[1];
                                                   $j("#payment-load"+userId).hide();
                                                   $j("#products-load"+userId).hide();
                                                   
                                             });  
                                           var subArr=objValue.split('||');
                                              if(subArr[0]!="")
                                              {
                                                $j("#payment-"+subArr[0]).html(subArr[1]);
                                                $j("#products-"+subArr[0]).html(subArr[2]);
                                              }
                                              
                                         }
                                      )                     
                      
                             } 
                           }
                       });  
               
               
             

      
          
      
      });   
    </script>
  
  <?php            
              echo($smarty->fetch('admin_footer.php'));
              
  }
  ?>
Return current item: MembersGear