コード例 #1
0
ファイル: login.php プロジェクト: salajss/eRecruitment
 function check($username, $password)
 {
     $q = "select * from er_login where username='******'and password='******'";
     $ob = new dbase();
     $res = $ob->execute($q);
     if (mysqli_num_rows($res) > 0) {
         $r = mysqli_fetch_array($res);
         $_SESSION['userid'] = $r['login_id'];
         if ($r['type'] == 1) {
             echo '<script>window.location="Admin/AdminHome.php";</script>';
             //header("location:../Admin/AdminHome.php");
         }
         if ($r['type'] == 2) {
             echo '<script>window.location="Company/CompanyHome.php";</script>';
             //header("location:../Company/CompanyHome.php");
         }
         if ($r['type'] == 3) {
             echo '<script>window.location="seeker/SeekerHome.php";</script>';
             //header("location:../seeker/SeekerHome.php");
         }
         //return $n=1;
     } else {
         $_SESSION['error'] = "Invalid Username or Password";
         echo '<script>window.location="index.php";</script>';
     }
 }
コード例 #2
0
<?php 
if ($_POST) {
    require_once 'lib/lib-cli.php';
    $security = new Security();
    $dbase = new dbase();
    $number = $security->StringFiltrate($_POST['number']);
    $text = $security->StringFiltrate($_POST['text']);
    $time = Date('H') . " : " . Date('i') . " : " . Date('s');
    if (strlen($number) > 0 && strlen($text) > 0) {
        if ($con = $dbase->connect_database()) {
            if ($db = $dbase->select_db($con)) {
                if ($dbase->query("insert into tews_send_gsm_log(command,receiver,month,day,year,time,marks) values('" . $text . "','" . $number . "','" . Date('m') . "','" . Date('d') . "','" . Date('Y') . "','" . $time . "','saved')")) {
                    header("location: lgu_control.php");
                    $dbase->close();
                } else {
                    $dbase->close();
                    echo "cant save!";
                }
            } else {
                $dbase->close();
                echo "cant select/found database";
            }
        } else {
            $dbase->close();
            echo "cant connect to server";
        }
        //die("<script  type='text/javascript'> window.location = 'lgu_control.php'; </script>");
    } else {
        header("location: lgu_control.php?err=no data found!");
    }
コード例 #3
0
require_once '../inc/config.php';
if (isset($_POST['id'], $_POST['object'], $_POST['field'], $_POST['value'])) {
    $id = $_POST['id'];
    $case = $_POST['object'];
    $field = $_POST['field'];
    $value = $_POST['value'];
    if ($value == 0) {
        $new_value = 1;
        if ($case == 'page' && $field == 'default') {
            $objDbase = new dbase();
            $objPage = new Page();
            $page = $objPage->getPages(array('id' => $id))[0];
            $pages = $objPage->getPages(array('default' => 1, 'group_id' => $page['group_id']));
            foreach ($pages as $page) {
                $objDbase->changeField('page', $page['id'], array('default' => 0));
            }
        }
    }
    if ($value == 1) {
        $new_value = 0;
    }
    $objDbase = new dbase();
    $params = array($field => $new_value);
    if ($objDbase->changeField($case, $id, array($field => $new_value))) {
        echo Helper::json(array('success' => true));
    } else {
        echo Helper::json(array('success' => false));
    }
} else {
    echo Helper::json(array('success' => false));
}
コード例 #4
0
ファイル: country.php プロジェクト: salajss/eRecruitment
 function select_qualification()
 {
     $qry = "select * from er_education";
     $ob = new dbase();
     return $ob->execute($qry);
 }
コード例 #5
0
ファイル: getRecords.php プロジェクト: nguyengiangoc/SugarKMS
<?php

require_once '../inc/config.php';
if (isset($_POST['object'])) {
    $case = $_POST['object'];
    $params = isset($_POST['params']) ? $_POST['params'] : '';
    $objDbase = new dbase();
    $result = $objDbase->get($case, $params);
    if (!empty($result)) {
        echo Helper::json(array('success' => true, 'result' => $result));
    } else {
        echo Helper::json(array('success' => false, 'case' => 1));
    }
} else {
    echo Helper::json(array('success' => false, 'case' => 2));
}
コード例 #6
0
ファイル: Untitled.php プロジェクト: nguyengiangoc/SugarKMS
<?php

require_once '../inc/config.php';
$objDbase = new dbase();
$objMember = new Member();
$members = $objMember->getMembers();
foreach ($members as $member) {
    $entity = $objMember->generateURLentity($member['name']);
    $sql = "UPDATE `members` SET `entity` = '" . $entity . "' WHERE `id` = " . $member['id'];
    $objDbase->query($sql);
}
コード例 #7
0
ファイル: seeker.php プロジェクト: salajss/eRecruitment
 function update_seeker($full_name, $mobile_number, $experience, $skill, $education, $master_education, $certification, $id)
 {
     echo $qry = "update er_seeker set full_name='{$full_name}', mobile_number={$mobile_number},`experience`='{$experience}',`skill`='{$skill}', `education`='{$education}',`master_education`={$master_education},`certification`='{$certification}' where login_id={$id}";
     $ob = new dbase();
     $ob->execute($qry);
 }
コード例 #8
0
ファイル: company.php プロジェクト: salajss/eRecruitment
 function update_company($first_name, $last_name, $designation, $contact_no, $company_id)
 {
     echo $q = "update er_company set first_name='{$first_name}',last_name='{$last_name}',designation='{$designation}',contact_number='{$contact_no}' where login_id={$company_id}";
     $ob = new dbase();
     return $ob->execute($q);
 }
コード例 #9
0
<?php

require_once '../inc/config.php';
if (isset($_POST['id']) && isset($_POST['object']) && isset($_POST['params'])) {
    $id = $_POST['id'];
    $case = $_POST['object'];
    $params = $_POST['params'];
    $objDbase = new dbase();
    // HANDLE SERIALIZE ARRAY
    if (array_key_exists(0, $params)) {
        $temp = array();
        foreach ($params as $array) {
            if (isset($array['value'])) {
                $temp[$array['name']] = $array['value'];
            } else {
                $temp[$array['name']] = '';
            }
        }
        $params = $temp;
    }
    switch ($case) {
        case 'recruitment':
            if (array_key_exists('deadline', $params)) {
                $deadline = date('Y-m-d', strtotime($params['deadline']));
                $params['deadline'] = $deadline;
            }
            break;
        case 'question':
            if ($params['type'] == 'radio' || $params['type'] == 'checkbox' || $params['type'] == 'dropdown') {
                foreach ($params['existing_choices'] as $choice) {
                    $objDbase->changeField('choice', $choice['id'], array('label' => $choice['label']));
コード例 #10
0
ファイル: job.php プロジェクト: salajss/eRecruitment
 function applycheck($user_id, $vacancy_id)
 {
     $qry = "select * from er_applay where vacancy_id={$vacancy_id} and user_id={$user_id} ";
     $ob = new dbase();
     $res = $ob->execute($qry);
     if ($res) {
         return 1;
     } else {
         return 0;
     }
 }
コード例 #11
0
        <?php 
if (isset($data['params']['question_id'])) {
    $params = $data['params'];
    $id = $params['question_id'];
    $objDbase = new dbase();
    $question = $objDbase->get('question', array('id' => $id));
    if (empty($question)) {
        $record = false;
    } else {
        $record = true;
        $question = $question[0];
    }
} else {
    $record = false;
}
if ($record) {
    ?>
                    <h2 class=" borderBottom">Edit Question :: Question #<?php 
    echo $id;
    ?>
 <a href="#" class="h2rightlink closeQuestion">Close</a></h2>
                    <div class="sectionParams" data-params="question_id=<?php 
    echo $id;
    ?>
"></div>
                    
                    <input type="hidden" value="<?php 
    echo $question['recruitment_id'];
    ?>
" name="recruitment_id" />
                    <input type="hidden" value="<?php 
コード例 #12
0
<?php

require_once '../inc/config.php';
if (isset($_POST['params']) && isset($_POST['object'])) {
    $case = $_POST['object'];
    $errors = array();
    $params = explode('&', $_POST['params']);
    $objDbase = new dbase();
    foreach ($params as $order => $row) {
        $field = str_replace('[]', '', explode('=', $row)[0]);
        $id = explode('=', $row)[1];
        $order++;
        if (!$objDbase->changeField($case, $id, array($field => $order))) {
            $errors[] = $id;
        }
    }
    if (empty($errors)) {
        echo Helper::json(array('error' => false));
    } else {
        throw new Exception(count($errors) . ' records could not be updated');
    }
} else {
    throw new Exception('Missing parameter');
}
コード例 #13
0
ファイル: category.php プロジェクト: salajss/eRecruitment
 function delete_location($id)
 {
     $qry = "delete from er_location where id={$id}";
     $ob = new dbase();
     return $ob->execute($qry);
 }
コード例 #14
0
ファイル: addRecord.php プロジェクト: nguyengiangoc/SugarKMS
<?php

require_once '../inc/config.php';
if (isset($_POST['object']) && isset($_POST['params'])) {
    $case = $_POST['object'];
    $params = $_POST['params'];
    $objDbase = new dbase();
    // HANDLE SERIALIZE ARRAY
    if (array_key_exists(0, $params)) {
        $temp = array();
        foreach ($params as $array) {
            $temp[$array['name']] = $array['value'];
        }
        $params = $temp;
    }
    switch ($case) {
        case 'position':
            $objPosition = new Position();
            $exco = $params['exco'];
            $project = $params['project'];
            if ($exco == '0') {
                $exco_order = '';
            }
            if ($exco == '1') {
                $last = $objPosition->getLastPosition(true);
                $exco_order = intval($last) + 1;
            }
            if ($project == '0') {
                $project_order = '';
            }
            if ($project == '1') {