Server IP : 108.163.255.210 / Your IP : 3.15.229.217 Web Server : Apache System : Linux blossom.urlnameserver.com 3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64 User : ( 1172) PHP Version : 7.2.34 Disable Function : eval,escapeshellarg,proc_close,proc_get_status,proc_nice,proc_open,symlink,system,pcntl_exec,getrusage,chown,chgp,closelog,openlog,syslog,define_syslog_variables,php_ini_loaded_file,getservbyname,getservbyport,posix_getgid,posix_getgrgid,proc_terminate,pfsockopen,apache_child_terminate,posix_mkfifo,posix_setpgid,posix_setuid,hypot,pg_host,pos,posix_access,posix_getcwd,posix_getservbyname,myshellexec,getpid,posix_getsid,posix_isatty,posix_kill,posix_mknod,posix_setgid,posix_setsid,posix_setuid,posix_times,posix_uname,ps_fill,posix_getpwuid,global,ini_restore,zip_open,zip_read,rar_open,bzopen,bzread,bzwrite,apache_get_modules,apache_get_version,phpversionphpinfo,php_ini_scanned_files,get_current_user,disk_total_space,diskfreespace,leak,imap_list,hypo,filedump,safe_mode,getmygid,apache_getenv,apache_setenv,bzread,bzwrite,bzopen,phpini,higlight_file,dos_conv,get_cwd,er_log,cmd,e_name,vdir,get_dir,only_read,ftok,ftpexec,posix_getpwnam,mysql_list_dbs,disk_free_space,session_save_path,confirm_phpdoc_compiled,zip_entry_rea,php_u,psockopen,crack_opendict,crack_getlastmessage,crack_closedict,crack_check,fpassthru,posix_get_last_error,posix_getlogin,posix_getgroups,posix_strerror,posix_getrlimit,posix_getpgrp,posix_getgrnam,pos,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/unilinki/www/Intellilead/leads/ |
Upload File : |
<?php include('../template/header.php'); if(isset($_POST['submit'])){ $c = count($_POST['l_ids']); $u = $_POST['assign_lead']; $role = getRoleIdByUserId($u); // print_r($_POST); die; for($i='0';$i<$c;$i++){ //echo $_POST['name'][$i]."<br/>"; $leadids = $_POST['l_ids'][$i]; if($_SESSION['role_id']=='6'){ if($role=='6' || $role=='8'){ $lead_status = '13'; $sql="update mstr_leads SET sales_by='".$_SESSION['user_id']."',sales_to='".$u."',sales_tc='".$_POST['assign_lead']."',lead_status='$lead_status' WHERE lead_id='$leadids'"; }else if($role=='7'){ $lead_status = '12'; $sql="update mstr_leads SET sales_by='".$_SESSION['user_id']."',sales_to='".$u."',lead_status='$lead_status' WHERE lead_id='$leadids'"; } }else if($_SESSION['user_id']==$_POST['assign_lead']){ $lead_status = '13'; $sql="update mstr_leads SET sales_to='".$_SESSION['user_id']."',sales_tc='".$_POST['assign_lead']."',lead_status='$lead_status' WHERE lead_id='$leadids'"; }else if($role=='8'){ $lead_status = '13'; $sql="update mstr_leads SET sales_tc='".$_POST['assign_lead']."',lead_status='$lead_status' WHERE lead_id='$leadids'"; }else{ $lead_status = '12'; $sql="update mstr_leads SET sales_by='".$_SESSION['user_id']."',sales_to='".$_POST['assign_lead']."',lead_status='$lead_status' WHERE lead_id='$leadids'"; } executeQuery($sql); $sql2="INSERT INTO mstr_history (lead_id,lead_status,assign_by,assign_tc,company_id,user_id,datetime) values('$leadids','$lead_status','".$_SESSION['user_id']."','".$_POST['assign_lead']."','".$_SESSION['company_id']."','".$_SESSION['user_id']."',NOW())"; executeQuery($sql2); } $fcmSender = new FCMSender(); $token = getTokenByUserid($u); $UserName = getUserName2($_SESSION['user_id']); $data = array( 'type' => LEAD_ASSIGNED, 'desc' => '('.$c.') New Leads is assigned to you by '.$UserName, 'title' => 'New Lead assign' ); //$fcmSender->sendMessage($token, $data); echo "<script type=\"text/javascript\"> alert(\"Selected Lead(s) Assigned Successfully.\"); window.location = \"manage_sales_leads.php\" </script>"; } $order_by= $_GET['order_by']; $order_by2= $_GET['order_by2']; if($order_by=='') { $order_by='lead_id'; } if($order_by2==""){ $order_by2='ASC'; } if($_SESSION['role_id']=='6'){ $lead_status="and lead_status ='6' and assign_by !='' and assign_to = '".$_SESSION['user_id']."'"; }else if($_SESSION['role_id']=='7') { $lead_status="and lead_status IN('6','12') and sales_to='".$_SESSION['user_id']."' or lead_status IN('6','12') and assign_to='".$_SESSION['user_id']."'"; }else{ $lead_status="and lead_status='6' and sales_tc='".$_SESSION['user_id']."'"; } $_SESSION['order_by2']=$order_by2; $_SESSION['sess_order_by']=$order_by; //==================================select data================ //pagination include('../includes/newPagers.php'); $Num_Records_Page = 25; $PGobj = new PagerClass(); if($_REQUEST['page']==""){ $cp=1; } else{ $cp=intval($_REQUEST['page']); } $PGobj->setCurrentPage($cp); $PGobj->SetCurpage($_SERVER['PHP_SELF']); $columns="SELECT * "; $listingsql=" FROM mstr_leads WHERE 1=1 and del_id !='1' and company_id ='".$_SESSION['company_id']."' ".$lead_status; //$listingsql=" FROM mstr_leads WHERE 1=1"; $reccnt = getSingleResult("SELECT COUNT(*) ".$listingsql); $limit = $PGobj->MyPaging($reccnt,$Num_Records_Page); $sql= $columns.$listingsql." order by $order_by $order_by2 ".$limit; $result= executeQuery($sql); $no= mysql_num_rows($result); ?> <script language="JavaScript"> function selectAll(source) { checkboxes = document.getElementsByName('l_ids[]'); for(var i in checkboxes) checkboxes[i].checked = source.checked; } </script> <!-- page heading start--> <div class="panel box-shadow-none content-header"> <div class="panel-body"> <div class="col-md-12"> <h3 class="animated fadeInLeft">Manage Leads</h3> <p class="animated fadeInDown"> Leads <span class="fa-angle-right fa"></span>Manage Leads </p> </div> </div> </div> <!-- page heading end--> <!--body wrapper start--> <?php include('../template/response.php');?> <div class="col-md-12 top-20 padding-0"> <div class="col-md-12"> <div class="panel"> <div class="panel-heading"><h3>Unassigned Leads List (<?php echo $reccnt;?>)</h3></div> <div class="panel-body"> <div class="responsive-table"> <form method="post" action="manage_sales_leads.php" name="form_frm"> <input type="hidden" name="haction"> <input type="hidden" name="id"> <div class="clearfix"> <?php if(in_array("10", $action_menu)){ ?><div class="btn-group"> <button id="add-new" type="button" class="btn btn-primary" onclick="window.location.href='add_leads_form.php';"> Add New Lead <i class="fa fa-plus"></i> </button> </div><?php } ?> <?php if(in_array("2", $action_menu)){ ?><div class="btn-group"> <button id="assign-lead" type="button" class="btn btn-primary" onclick="window.location.href='view_sales_leads.php';"> View Assigned Leads </button> </div><?php } ?> <?php if(in_array("20", $action_menu)){ ?><div class="btn-group"> <button id="assign-lead" type="button" class="btn btn-success" onclick="window.location.href='assign_sales_leads.php';"> Forwarded to Sales Team </button> </div><?php } ?> <?php if(in_array("30", $action_menu)){ ?><div class="btn-group"> <button id="delete-selected" class="btn btn-primary" onclick="want_to_Delete()"> Delete Selected <i class="fa fa-trash-o"></i> </button> </div><?php } ?> </div> <p></p> <table class="table table-striped table-bordered" width="100%" cellspacing="2"> <thead class="cf"> <tr> <th class="sorting_disabled"> <div class="form-group form-animate-checkbox"> <input type="checkbox" class="checkbox" id="selectall" onClick="selectAll(this)"> </div> </th> <th>Lead Code</th> <th>Project Name</th> <th>Source</th> <th>Name</th> <th>Email</th> <th>Mobile</th> <th>Phone</th> <th>Interested In</th> <th>Budget</th> <?php if(in_array("22", $action_menu) || in_array("33", $action_menu)){ ?><th>Action</th><?php } ?> </tr> </thead> <tbody> <?php if($no>0){ while($line=mysql_fetch_array($result)) { ?> <tr> <td> <div class="form-group form-animate-checkbox"> <input name="l_ids[]" type="checkbox" value="<?php echo $line['lead_id']?>" class="checkbox"> </div> </td> <td><?php echo $line['lead_code']?></td> <td><?php echo $line['project_name']?></td> <td><?php echo $line['source']?></td> <td><?php echo $line['name']?></td> <td><?php echo $line['email']?></td> <td><?php echo $line['mobile']?></td> <td><?php echo $line['phone']?></td> <td><?php echo $line['interested']?></td> <td><?php echo $line['budget']?></td> <?php if(in_array("22", $action_menu) || in_array("33", $action_menu)){ ?><td> <ul class="nav nav-tabs"> <?php if(in_array("2", $action_menu)){ ?><li><a href="edit_leads_form.php?id=<?php echo $line['lead_id']?>" class="tooltips edit-btn" data-placement="top" data-toggle="tooltip" data-original-title="Edit"><i class="fa fa-edit"></i> </a></li><?php } ?> <?php if(in_array("30", $action_menu)){ ?><li><a href="#" class="tooltips delete-btn" data-placement="top" data-toggle="tooltip" data-original-title="Delete" onClick="want_to_Delete_qt('<?php echo $line['lead_id']; ?>');"><i class="fa fa-trash-o"></i> Delete</a></li><?php } ?> </ul></td> <?php } ?> </tr> <?php } ?> <tr> <td colspan="12" style="margin:0px auto; text-align:center; color:#282828; font-size:14px; font-variant:small-caps; font-weight:bold;"> <div class="col-md-3"> <h5>Assigning the Leads :</h5> </div> <div class="col-md-6"> <select class="form-control" name="assign_lead"> <?php if($_SESSION['role_id']=='7'){ $role = "role_id IN (6,7,8) and rep_head='".$_SESSION['user_id']."' or user_id='".$_SESSION['user_id']."'"; }else{ $role = "role_id IN (6,7,8)"; } $Roleresult= executeQuery("SELECT user_id,name,role_id FROM mstr_user where status='Active' and company_id ='".$_SESSION['company_id']."' and user_type !='0' and $role"); while($row=mysql_fetch_array($Roleresult)) { ?> <option value="<?php echo $row['user_id'];?>"><?php echo $row['name'];?> - <?php echo getRoleName($row['role_id']);?></option> <?php }?> </select> </div> <div class="col-md-3"> <input class="submit btn btn-danger" type="submit" name="submit" value="Submit"> </div> </td> </tr> <?php }else {?> <tr> <td colspan="100%" style="margin:0px auto; text-align:center; color:#282828; font-size:14px; font-variant:small-caps; font-weight:bold;"> Your Leads List is Empty.</td> </tr> </p> <?php }?> </tbody> </table> <div class="col-md-6" style="padding-top:20px;"> <span><?php echo $PGobj->showEntries($no); ?></span> </div> <div class="col-md-6"> <?php echo $PGobj->showPagerContent(); ?> </div> </form> </div> </div> </div> </div> </div> <!--body wrapper end--> <?php include('../template/footer.php');?>