Jump to content

Cubeboy

Member
  • Posts

    48
  • Joined

  • Last visited

About Cubeboy

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Cubeboy's Achievements

Member

Member (2/3)

0

Reputation

  1. it does redirect, with no page just an error ERR_TOO_MANY_REDIRECTS
  2. Any help would be greatly appreciated. I made a hook for whmcs. It needs to load a specific page (ie insidesales.php) depending on the Admin Role instead the support page or the home page, I use the lastest whmcs.... THANK YOU!! <?php use WHMCS\Admin; function addon_hook_AdminAreaPage($vars) { // Retrieve the admin's ID $adminID = Admin::getUserID(); // Query the tbladminroles table to check if the admin's ID matches the desired ID $desiredRoleID = 5; $isAdminInsideSales = Capsule::table('tbladminroles') ->where('id', $desiredRoleID) ->where('adminid', $adminID) ->exists(); // If the admin is in the desired role, redirect to insidesales.php if ($isAdminInsideSales) { $redirectURL = 'insidesales.php'; header("Location: $redirectURL"); exit; } } add_hook('AdminAreaPage', 1, 'addon_hook_AdminAreaPage');
  3. I need a hook for whmcs. it needs to load a specific page (ie salesppl.html or something) depending on the Admin Role or Admin Name instead the support page. A broke example: [?php add_hook('AdminAreaPage', 1, function($vars ) { $extraVariables = []; if ($vars['URL'] == 'insidesales.html') $extraVariables['admin_username'] = 'user1 , user2 ' else $extraVariables['administratorroles'] = 'Inside Sales'; } return $extraVariables; });
  4. We have started our sales department for our company we grouped them under 'inside sales' I would when they log in they get redirected to their sales page. I tried to do a hook and even have tried to user a user name as well. I rather get it to work with one one variable and it works depending on the 'Administrator Roles' <?php add_hook('AdminAreaPage', 1, function($vars) { $extraVariables = []; if ($vars['filename'] == 'addonmodules.php?module=metrics') { $extraVariables['admin_username'] = 'djone' else $extraVariables['administratorroles'] = 'Inside Sales'; } return $extraVariables; }); Thank you for all your help in advance....
  5. I did Find the a bad solution, however I can't ask all my clients to do this. https://www.technipages.com/google-chrome-bypass-blocked-cross-origin-frame Also all whmcs Integration Code section no longer works!
  6. JQMIGRATE: Migrate is installed, version 3.3.2 domain.com/dologin.php:130 Blocked autofocusing on a <input> element in a cross-origin subframe. index.php:133 Blocked autofocusing on a <input> element in a cross-origin
  7. This has plagued me!!!! looked everywhere I know, this happens in chrome, firefox works fine. Please any new ideas, don't be shy. I am trying to access my whmcs install from a iframe (it worked perfect before the last upgrade) <iframe name="Portal" src="https://domain.com/index.php?rp=/login" height="1500" width="100%" ></iframe></p> The login page loads the page as it should but it won't let any clients log in This is what I have tried so far: Clear cache and cookies, also did a dnsflush on my local computer Changed PHP version, now using 7.4.28 Changed session path to: /var/cpanel/php/sessions/ea-php74 (chmod 777) phpinfo session.save_path /var/cpanel/php/sessions/ea-php74 Also changed: vi /usr/local/cpanel/3rdparty/php/74/etc/php.ini (to above path) Disabled CSRF Checks in whmcs setting ( tried every combination with both toggles) (CSRF Tokens: General), (CSRF Tokens: Domain Checker) Added all Ip's from my hosting server to my whmcs server in the "API IP Access Restriction" box Thank You!
  8. I know them maybe a dum question, however I am interested in getting the Lic Addon product, What will I need in order to product the end result? Will I need to buy an encoder or is the Licensing Addon a complete self contained package? All comments welcome - ish
  9. this is a snippet of my quote/contract script it seems to know the recurring but not the onetime, it shows the "unit price" but no the "total price I need to have the one time and payments show up in the contract the 2 hooks you need to add in //term is the call // 1 displays the number of months [term: 1] [recur:36] <?php $pdf->Image(ROOTDIR.'/assets/img/rwclogo.png', 63,10,75,'c'); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','B',11); $pdf->Cell(175,40,"CONTRACT FOR $subject ONLINE MARKETING SERVICES",25,1,'C'); $total_onetime = 0; $total_recur = array(); foreach ($lineitems AS $item) { $description = $item["description"]; # find term $matches = array(); preg_match('/\[term:(.*?)\]/i', $description, $matches); if (empty($matches)) { $term = ''; } else { $term = strtolower(trim($matches[1])); $description = str_replace($matches[0], '', $description); } # find recur $matches = array(); preg_match('/\[recur:(.*?)\]/i', $description, $matches); if (empty($matches)) { $recur = ''; } else { $recur = strtolower(trim($matches[1])); $description = trim(str_replace($matches[0], '', $description)); } # get unit price and total price $matches = array(); preg_match('/\d+\.\d+/', $item['unitprice'], $matches); $item_unitprice = (float)$matches[0]; $matches = array(); preg_match('/\d+\.\d+/', $item['total'], $matches); $item_total = (float)$matches[0]; # add onetime and recurring totals if ($recur == '') { $total_onetime += $item_total; } else { if (!array_key_exists($recur, $total_recur)) { $total_recur[$recur] = 0; } $total_recur[$recur] += $item_total; } } $pdf->SetFont('freesans','B',9); if ($total_onetime > 0) { } foreach (array('monthly', 'quarterly', 'semi-annually', 'annually', 'biennially') as $recur) { if (isset($total_recur[$recur]) && $total_recur[$recur] > 0) { } unset($total_recur[$recur]); } # any remaining recurs foreach ($total_recur as $recur => $amount) { } #========================================================================== # determine weather to show the ONE TIME payment or not #if ( $total_onetime < 100 ) { #$ot_show = false; #} #else { #$ot_show = true; #} #========================================================================== # determines weather or not to split the initial payment in half #if ( $total_onetime >= 10000 ) { #$bulk = $total_onetime / 2; #$addtl_payment_msg = 'and the second half of $' .$bulk. ', will be due within 60 days. '; #} else { #$bulk = $total_onetime; #$addtl_payment_msg = ''; } #========================================================================== #calculate One time payment using monthly pymts as a varible #========================================================================== #$otpp = ( $total_recur[$recur] * $recur ); #$ots = ( $otpp * .1); #$ots = round( $ots, 2, PHP_ROUND_HALF_UP ); #$otp = $otpp - ($otpp * .1); #$otp = round( $otp, 2, PHP_ROUND_HALF_UP ); #========================================================================== #calculate One time payment and monthly payment to come up with a total #$totalot = ( $total_recur[$recur] * $recur + $bulk ); #$totalot10 = ( $totalot - $ots ); #========================================================================== $pdf->SetDrawColor(255); $pdf->SetFillColor(255); $pdf->SetFont('freesans','B',9); $pdf->Cell(170,5,"Authorization:",0,0,'L'); $pdf->SetFont('freesans','',9); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','',9,C); $pdf->MultiCell(170,5," This document defines the TERMS AND CONDITIONS (T&C) of our working relationship. All projects or services (“the work”) that AGENCY (or “we”) RWC ME 04401 may be contracted to produce or provide for CLIENT ($clientsdetails[companyname]) will be subject to and you the undersigned agree to the following: The CLIENT authorizes the AGENCY access CLIENT's current website, webhost, and all digital materials to transfer as needed from the CLIENT for the purposes of completeing the work on the domain $subject. The CLIENT authorizes use of CLIENT's logo and all brand identification in the creation of the website. The CLIENT understands they are entering into a$pdf->Cell $recur month contract with THE AGENCY. The Agency will only begin work after CLIENT’s approval of the project authorization to proceed,(ATP) and the terms and conditions,(T&C) and after receipt of payment of the initial invoice $".$total_onetime. ". Your signature/execution of the ATP and the T&C will constitute an AGREEMENT between us. "); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','B',9); $pdf->Cell(170,5,"Description of the work:",0,0,'L'); $pdf->SetFont('freesans','',9); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','',9,L); $pdf->MultiCell(170,5,"$notes",0,1,'C'); if ($proposal) { $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','B',9); $pdf->Cell(170,5,"Installment Plan:",0,0,'L'); $pdf->SetFont('freesans','',9); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','',9,L); $pdf->MultiCell(170,5,$proposal ); } $pdf->AddPage(); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','B',9); $pdf->Cell(170,5,"Approvals:",0,0,'L'); $pdf->SetFont('freesans','',9); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','',9,L); $pdf->MultiCell(170,5," $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','B',9); $pdf->Cell(170,5,"Additions and Alterations:",0,0,'L'); $pdf->SetFont('freesans','',9); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','',9,C); $pdf->MultiCell(170,5," "); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','B',9); $pdf->Cell(170,5,"Payments:",0,0,'L'); $pdf->SetFont('freesans','',9); $pdf->MultiCell(170,5,""); $pdf->SetFont('freesans','',9,L); $pdf->MultiCell(170,5,"The AGENCY is providing Online Marketing Services in advance of total payment. The CLIENT will have an initial down payment of $" . $bulk . ". that is due at the signing of this contract, " .$addtl_payment_msg. "Then an ongoing payment of $pdf->Cell $$total_recur[$recur], on a monthly basis for the following$pdf->Cell $recur months, starting from the date of signing this agreement. " ); $pdf->MultiCell(170,5,""); $pdf->AddPage(); $pdf->Image(ROOTDIR.'/assets/img/rwclogo.png', 63,10,75,'c'); $pdf->SetFont('freesans','B',11); $pdf->Ln(); $pdf->SetFont('freesans','B',9); $pdf->Ln(); $pdf->SetFont('freesans','',9); $pdf->MultiCell(39,5,""); $pdf->Ln(); $pdf->SetFont('freesans','B',9); $pdf->SetDrawColor(200); $pdf->SetFillColor(239); $pdf->SetFont('freesans','',9); $pdf->Cell(10,6,"Qty",1,0,'C','1'); $pdf->Cell(80,6,"Description",1,0,'C','1'); $pdf->Cell(20,6,"Recur",1,0,'C','1'); $pdf->Cell(20,6,"Term",1,0,'C','1'); $pdf->Cell(20,6,"Unit Price",1,0,'C','1'); $pdf->Cell(20,6,"Total",1,0,'C','1'); $pdf->Ln(); $pdf->SetFont('freesans','B',9); $total_onetime = 0; $total_recur = array(); foreach ($lineitems AS $item) { $description = $item["description"]; #========================================================================== # find term #========================================================================== $matches = array(); preg_match('/\[term:(.*?)\]/i', $description, $matches); if (empty($matches)) { $term = ''; } else { $term = strtolower(trim($matches[1])); $description = str_replace($matches[0], '', $description); } #========================================================================== # find recur #========================================================================== $matches = array(); preg_match('/\[recur:(.*?)\]/i', $description, $matches); if (empty($matches)) { $recur = ''; } else { $recur = strtolower(trim($matches[1])); $description = trim(str_replace($matches[0], '', $description)); } #========================================================================== # get unit price and total price #========================================================================== $matches = array(); preg_match('/\d+\.\d+/', $item['unitprice'], $matches); $item_unitprice = (float)$matches[0]; $matches = array(); preg_match('/\d+\.\d+/', $item['total'], $matches); $item_total = (float)$matches[0]; #========================================================================== # add onetime and recurring totals #========================================================================== if ($recur == '') { $total_onetime += $item_total; } else { if (!array_key_exists($recur, $total_recur)) { $total_recur[$recur] = 0; } $total_recur[$recur] += $item_total; } #========================================================================== # display line items #========================================================================== $numlines = ceil(strlen($description)/55); $cellheight = $numlines * 8; $pdf->MultiCell(10,$cellheight,$item["qty"],1,'C','',0); $pdf->MultiCell(80,$cellheight,$description,1,'L','',0); $pdf->MultiCell(20,$cellheight,$recur,'1','C','',0); $pdf->MultiCell(20,$cellheight,$term,'1','C','',0); $pdf->MultiCell(20,$cellheight,sprintf('$%.2f',$item_unitprice),1,'C','',0); $pdf->MultiCell(20,$cellheight,sprintf('$%.2f',$item_total),1,'C','',1); } $pdf->SetFont('freesans','B',9); /* $pdf->Cell(145,6,"Subtotal",1,0,'R','1'); $pdf->Cell(25,6,$currencysymbol.$subtotal,1,0,'C','1'); $pdf->Ln(); if ($taxlevel1["rate"]>0) { $pdf->Cell(145,6,$taxlevel1["name"]." @ ".$taxlevel1["rate"]."%",1,0,'R','1'); $pdf->Cell(25,6,$currencysymbol.$tax1,1,0,'C','1'); $pdf->Ln(); } if ($taxlevel2["rate"]>0) { $pdf->Cell(145,6,$taxlevel2["name"]." @ ".$taxlevel2["rate"]."%",1,0,'R','1'); $pdf->Cell(25,6,$currencysymbol.$tax2,1,0,'C','1'); $pdf->Ln(); } $pdf->Cell(145,6,"Total",1,0,'R','1'); $pdf->Cell(25,6,$currencysymbol.$total,1,0,'C','1'); $pdf->Ln(); */ if ($total_onetime > 0) { $pdf->Cell(150,6,'Pre-Pay',1,0,'R',1); $pdf->Cell(20,6,sprintf('$%.2f',$total_onetime),1,0,'C',1); $pdf->Ln(); } foreach (array('monthly', 'quarterly', 'semi-annually', 'annually', 'biennially') as $recur) { if (isset($total_recur[$recur]) && $total_recur[$recur] > 0) { $pdf->Cell(150,6,ucfirst($recur) . ' Monthly Payments',1,0,'R',1); $pdf->Cell(20,6,sprintf('$%.2f',$total_recur[$recur]),1,0,'C',1); $pdf->Ln(); } unset($total_recur[$recur]); } #========================================================================== # any remaining recurs #========================================================================== foreach ($total_recur as $recur => $amount) { $pdf->Cell(150,6,ucfirst($recur) . ' Monthly Payments',1,0,'R',1); $pdf->Cell(20,6,sprintf('$%.2f',$amount),1,0,'C',1); $pdf->Ln(); } $pdf->SetFont('freesans','',9,l); $pdf->MultiCell(170,5,"
  10. I used to use .$CLIENTsdetails["AGENCYname"]. in my quote from to pull the clients info, however that no longer works, I have looked in the release notes and can not find anything to resolve this. can anyone help? more uses: $pdf->MultiCell(170,5,"CLIENT, ".$client_first_name." ".$client_last_name["lastname"]. ":_________________________________ Date _____________
  11. I used to use .$CLIENTsdetails["AGENCYname"]. in my quote from to pull the clients info, however that no longer works, I have looked in the release notes and can not find anything to resolve this. can anyone help? more uses: $pdf->MultiCell(170,5,"CLIENT, ".$client_first_name." ".$client_last_name["lastname"]. ":_________________________________ Date _____________
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated