Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2009
    Location
    Yeovil - Somerset
    Posts
    42

    PHP Smarty / Efront

    Hi, does any one know much about Smarty and open source script called Efront

    As need some assistance in this field if anybody would like to help me

    Thanks
    Aaron

  2. #2
    I'm familiar with smarty. Post your question to see if i can get you some help
    Web Hosting by Brontobytes

  3. #3
    Join Date
    Jul 2009
    Location
    Yeovil - Somerset
    Posts
    42
    Sent PM with information due to login credentials

  4. #4
    Join Date
    Jul 2009
    Location
    Yeovil - Somerset
    Posts
    42
    Still require help if anybody interested i will send the information i will send the login details etc via PM as easier.

    Thanks
    Aaron

  5. #5
    Join Date
    Jul 2009
    Location
    Yeovil - Somerset
    Posts
    42
    I looked into the code and when i do:

    print_r for the Array it out puts this:

    Array { } with nothing in it?

    So does that mean its a Variable issue not matching up with all the informnation?

    Aaron

  6. #6
    Join Date
    Dec 2002
    Location
    chennai , tamil nadu , IN
    Posts
    1,423
    Quote Originally Posted by aaron1988 View Post

    So does that mean its a Variable issue not matching up with all the informnation?

    Aaron
    It means the Array in empty and is not being populated correctly.
    Chris, Developer/Programmer,
    Php laravel developers,
    Ruby on Rails developers,
    www.chrisranjana.com

  7. #7
    Join Date
    Jul 2009
    Location
    Yeovil - Somerset
    Posts
    42
    Yh, thats what i was thinking just cant seem to find the error as it adds it into database just doesnt populate onto screen

    Aaron

  8. #8
    Your query might not be matching any data, you should paste your code here.

  9. #9
    Join Date
    Jul 2009
    Location
    Yeovil - Somerset
    Posts
    42
    Ok Code is here:

    PHP Code:
    public function onPageFinishLoadingSmartyTpl(){
        
            
    $smarty $this -> getSmartyVar();

            
    $smarty -> assign('T_ASSIGNQUALS'null);
            
            if(isset(
    $_GET['delqual']) && $_GET['delqual'] != null && isset($_GET['user']) && $_GET['user'] != null){
                
                
    $login mysql_real_escape_string($_GET['user']);
                
    $qual mysql_real_escape_string($_GET['delqual']);
                
                
    $path "administrator.php?ctg=personal&user=$login&op=quals";
                
                
    eF_deleteTableData('sdms_persqual',"id='$qual' && personkey='$login'");
                    
                
    $t_conf _SDMS_QUALREMOVED;
                
    eF_redirect($path.'&message='.$t_conf.'&message_type=success');
            
            }
            
            if(isset(
    $_GET['ctg']) && $_GET['ctg'] == 'personal' && isset($_GET['user']) && $_GET['user'] != null){    
                
            
    //    $smarty -> assign("T_MODULE_BASEURL" , 'administrator.php?ctg=personal&user=cmead');
                
    $user eF_addSlashes($_GET['user']);
                
    $qualsArray $this -> getUserQuals($login);
                
                
    $user_type $this -> getCurrentUser() -> user['user_type'];
            
    //    print_r($user_type);
                
    $smarty -> assign('T_USR_TYPE'$user_type);
                
    $smarty -> assign('T_ADDQUAL_LINK'$this -> moduleBaseUrl."&sdms_section=assignuserqual&ref=".$user);
                
    $smarty -> assign('T_QUALS_ARRAY'$qualsArray);
                
            }
        } 
    And:

    PHP Code:
    public function getUserQuals($login){
        
            
    ///  CODE TO ARRAY USER QUALIFICATIONS FOR SMARTY TEMPLATE.
            
    $getQuals eF_getTableData('sdms_persqual''id, certificatekey, award_ts, expirey_ts, evidenced, grade, subject, targetdate_ts, achievementstatus'"personkey='".$login."'");
            
            
    $returnArray = array();
            
            foreach(
    $getQuals AS $key => $data){
                
                
    $qualID $data['certificatekey'];
                
    $getQual eF_getTableData('sdms_certific''certificatetitle, certificatereference'"id='".$qualID."'");
                
                
    $qualReference $getQual[0]['certificatereference'];
                
    $qualTitle $getQual[0]['certificatetitle'];
                
    $achievementCode $data['achievementstatus'];
                
    $subjectCode $data['subject'];
                
    $evidenced = ($data['evidenced'] == 0) ? "forbidden.png" "success.png";
                
                
    $evidenced "<img border='0' src='images/16x16/"$evidenced ."'>";
                
                
    $subjectTitle $this -> buildCodesDropDown("CERTSUBJE"$subjectCode);
                
    $subjectTitle $subjectTitle[$subjectCode];
                
                
    $achievementStatus $this -> buildCodesDropDown("CERTACHIEV"$achievementCode);
                
    $achievementStatus = ($achievementCode != '0') ? $achievementStatus[$achievementCode] : '';
                
                
    $awardDate = ($data['award_ts'] == 0) ? "N/A" date("d/m/Y"$data['award_ts']);
                
    $targetDate = ($data['targetdate_ts'] == 0) ? "N/A" date("d/m/Y"$data['targetdate_ts']);
                
    $expireyDate = ($data['expirey_ts'] == 0) ? "N/A" date("d/m/Y"$data['expirey_ts']);
                
                
    $persQualID $data['id'];
                
    $operations "<a href='" $this -> moduleBaseUrl "&sdms_section=assignuserqual&ref=".$login."&modqual=".$persQualID."'><img border='0' src='images/16x16/edit.png'></a><a href='administrator.php?ctg=personal&user=$login&op=quals&delqual=$persQualID'><img border='0' title='" _SDMS_TT_DELETE "' src='images/16x16/error_delete.png'></a>";
                
                
    $grade eF_getTableData('sdms_gradetoqualtype','grade',"id='".$data['grade']."'");
                
    $grade $grade[0]['grade'];
                
                
    $returnArray[$key] = array(    'id' => $persQualID,
                                            
    'reference' => $qualReference,
                                            
    'title' => $qualTitle,
                                            
    'grade' => $grade,
                                            
    'awardDate' => $awardDate,
                                            
    'targetDate' => $targetDate,
                                            
    'expireyDate' => $expireyDate,
                                            
    'subject' => $subjectTitle,
                                            
    'achievement' => $achievementStatus,
                                            
    'evidenced' => $evidenced,
                                            
    'operations' => $operations
                                        
    );
            
            }
            
    //var_dump($returnArray);
            
    return $returnArray;
        } 
    PHP Code:
    private function assignOfferedQualsForm($courseID){
        
            
    $smarty $this -> getSmartyVar();
            
            
    $path $this -> moduleBaseUrl "&sdms_section=courses&func=edit&ref=$courseID&def_tab=ecc_quals";
            
            
    $expireyTypes = array( 'd' => _SDMS_DAYS'm' => _SDMS_MONTHS'y' => _SDMS_YEARS);
            
            if(isset(
    $_GET['modqual'])){
                
                
    $actQualID mysql_real_escape_string($_GET['modqual']);
                
                
    $path $path "&updt=$actQualID";
                
                
    $getActCerti eF_getTableData('sdms_actcerti','certificatekey, expireytype, expireyperiod, mandatory',"id='$actQualID'");
                
    $arrActCerti =$getActCerti[0]
                ;
                
    $certificateKey $arrActCerti['certificatekey'];
                
    $expireT $arrActCerti['expireytype'];
                
    $expireP $arrActCerti['expireyperiod'];
                
    $mandatory $arrActCerti['mandatory'];
                
    $expireTTitle $expireyTypes[$expireT];
                
                
    $getCertificate eF_getTableData('sdms_certific','certificatetitle',"id='$certificateKey'");
                
    $arrCertificate $getCertificate[0];
                
    $certTitle $arrCertificate['certificatetitle'];
                
                
    $qualDropDown = array($certificateKey => $certTitle);
                
                
    $expireyDropDown[$expireT] = $expireTTitle;
                
                foreach(
    $expireyTypes AS $type => $title){
                
                    if(
    $type != $expireT){
                    
                        
    $expireyDropDown[$type] = $title;
                    
                    }
                
                }
                
                
    $buttonTag "Update";
            
            }else{
            
                
    $qualsOverview $this -> buildQualificationsOverview(1);
                
    $qualDropDown = array(=> _SDMS_DROPLISTSELECT);
                
                foreach(
    $qualsOverview AS $key => $qualArray){
                
                    
    $qualID $qualArray['id'];
                    
    $qualTitle $qualArray['title'];
                    
                    
    $qualDropDown[$qualID] = $qualTitle;
                
                }
                
                
    $expireyDropDown $expireyTypes;
                
    $expireP "";
                
    $mandatory 1// DEFAULT MANDATORY VALUE FOR NEW ASSIGN FORM.
                
    $buttonTag "Assign Qualification";
            }
            
            if(
    $mandatory == 1){
            
                
    $checked "checked";
            
            }else{
            
                
    $checked "";
            
            }
            
            
    $form = new HTML_QuickForm("AssignQual""POST"$path""nulltrue);
        
            
    $form -> addElement('select''qual'_SDMS_QUALIFICATION .": "$qualDropDown);
            
    $form -> addElement('checkbox''mandatory'_SDMS_MANDATORY .": "null"$checked");
            
    $form -> addElement('text''expire_value'_SDMS_EXPIRESAFTER .": ", array('size' => 3'maxlength' => 3'value' => $expireP));
            
    $form -> addElement('select''expire_type'"&nbsp;"$expireyDropDown);
            
    $form -> addElement('submit''sub_assignQual'_SDMS_ASSIGNQUALIFICATION'class = "flatButton"');
            
            
            if(
    $form -> isSubmitted() && $form -> validate()){
                
                
    $values $form -> exportValues();
                
                
    $qualKey $values['qual'];
                
    $mandatory = ($values['mandatory'] == null) ? 1;
                
    $expireValue = ($values['expire_value'] == '0' || $values['expire_value'] == null) ? '0' $values['expire_value'];
                
    $expirePeriod = ($values['expire_value'] == '0' || $values['expire_value'] == null) ? '0' $values['expire_type'];
                
    $update 0;
                
                
    $checkQual eF_getTableData('sdms_actcerti','id',"activitykey='$courseID' && certificatekey='$qualKey'");
                
    $checkQual count($checkQual);
                
                if(isset(
    $_GET['updt'])){
                
                    
    $update mysql_real_escape_string($_GET['updt']);
                
                }
                
                if(
    $checkQual && $update == 0){
                
                    
    $t_conf _SDMS_QUALALREADYLISTED;
                    
    $outcome "failure";
                    
    $this -> setMessageVar($t_conf$outcome);
                
                }elseif(
    $qualKey == '0'){
                
                    
    $t_conf _SDMS_NOQUALIFICATIONSELECTED;
                    
    $outcome "failure";
                    
    $this -> setMessageVar($t_conf$outcome);
                                    
                }else{
                    
                    
    $data = array(    'activitykey' => $courseID
                                    
    'certificatekey' => $qualKey
                                    
    'expireytype' => $expirePeriod
                                    
    'expireyperiod' => $expireValue
                                    
    'mandatory' => $mandatory
                                
    );
                    
                    if(
    $update >= 1){
                        
                        
    eF_updateTableData('sdms_actcerti',$data,"id='$update'");
                        
                        
    $t_conf _SDMS_QUALUPDATED;
                        
                    }else{
                        
                        
    eF_insertTableData('sdms_actcerti'$data);
                        
                        
    $t_conf _SDMS_QUALIFICATIONASSIGNED;
                        
                    }
                    
                    
    eF_redirect($path.'&message='.$t_conf.'&message_type=success');
                    
                }
                
            }
            
            if(isset(
    $_GET['deloffqual'])){
            
                
    $actQualID mysql_real_escape_string($_GET['deloffqual']);
                
    $query mysql_query("DELETE FROM sdms_actcerti WHERE id='$actQualID'");
            
            }
            
            
    $renderer prepareFormRenderer($form);
            
    $form $renderer -> toArray();
            return 
    $form;
        
        } 
    Sorry theres a lot of code so i am hoping this is all you need.

    Thanks
    Aaron

Similar Threads

  1. Inserting PHP/HTML in Smarty
    By evsion in forum Programming Discussion
    Replies: 4
    Last Post: 03-29-2008, 12:04 PM
  2. PHP and Smarty Errors
    By CoryHawk in forum Hosting Security and Technology
    Replies: 3
    Last Post: 08-21-2007, 03:28 AM
  3. PHP: Smarty Question?
    By dale1991 in forum Programming Discussion
    Replies: 1
    Last Post: 08-03-2006, 09:15 PM
  4. Looking for Php/Smarty help
    By WiredMom in forum Employment / Job Offers
    Replies: 5
    Last Post: 10-12-2004, 07:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •