Ejemplo n.º 1
0
function kfm_search($keywords, $tags)
{
    include_once KFM_BASE_PATH . 'includes/files.php';
    return _search($keywords, $tags);
}
<?php

require '../config.php';
$get = GETPOST('get');
switch ($get) {
    case 'search':
        __out(_search(GETPOST('key')), 'json');
        break;
    default:
        break;
}
function _search($keyword)
{
    global $db, $conf, $langs;
    $Tab = array();
    $TType = array('invoice', 'commande', 'propal', 'projet', 'task', 'company', 'contact', 'event', 'product', 'facture_fournisseur', 'commande_fournisseur', 'fichinter');
    if (!empty($conf->of->enabled)) {
        $TType[] = 'ordre_fabrication';
    }
    //$TType=array('facture_fournisseur', 'commande_fournisseur');
    foreach ($TType as $type) {
        $Tab[$type] = _search_type($type, $keyword);
    }
    return $Tab;
}
function _search_type($type, $keyword)
{
    global $db, $conf, $langs;
    $table = MAIN_DB_PREFIX . $type;
    $objname = ucfirst($type);
    $id_field = 'rowid';
Ejemplo n.º 3
0
    // getmails
    $result[] = _search('mail', 'mail_get');
    // dns zones
    $result[] = _search('dns', 'dns_soa');
    // secondary dns zones
    $result[] = _search('dns', 'dns_slave');
    // virtual machines
    $result[] = _search('vm', 'openvz_vm');
    // virtual machines os templates
    $result[] = _search('vm', 'openvz_ostemplate');
    // virtual machines vm templates
    $result[] = _search('vm', 'openvz_template');
    // virtual machines ip addresses
    $result[] = _search('vm', 'openvz_ip');
    // directive snippets
    $result[] = _search('admin', 'directive_snippets');
    $json = $app->functions->json_encode($result);
}
//}
function _search($module, $section, $additional_sql = '')
{
    global $app, $q, $authsql, $modules;
    $result_array = array('cheader' => array(), 'cdata' => array());
    if (in_array($module, $modules)) {
        $search_fields = array();
        $desc_fields = array();
        if (is_file('../' . $module . '/form/' . $section . '.tform.php')) {
            include_once '../' . $module . '/form/' . $section . '.tform.php';
            $category_title = $form["title"];
            $form_file = $form["action"];
            $db_table = $form["db_table"];
Ejemplo n.º 4
0
			$msg= "<p align ='center'>".sprintf(_Pilot_email_used_in_pre_reg_dif_civlid,$r['user_name'])." </p>";
		} else if($r['user_civlid']==$civlid && $civlid ){
			$msg= "<p align ='center'>".sprintf(_Pilot_civlid_used_in_pre_reg_dif_email,$r['user_name'])."</p>";
		} else {
			$msg="<p align ='center'>"._Pilot_have_pre_registration."</p>";
		}	
		echo $msg; closeMain(); return;	
	}
		
	if($r=_search($_POST['email'],$civlid,$username,'pilots') && $civlid!=0 ){
	 	//  var_dump($r);
		$msg= "<p align ='center'>".sprintf(_Pilot_already_registered, $r['CIVL_ID'], $r['CIVL_NAME']) ."</p>";	 
		echo $msg; closeMain(); return;
	}
	
    if(!$r=_search($_POST['email'],$civlid,$username,'users')) {
		 
		 $actkey=md5(uniqid(rand(), true));
		 $session_time=time();
		 $sql="INSERT into ".$CONF['userdb']['users_temp_table']."(
		 user_civlid,user_civlname,user_name,user_firstname,user_lastname,user_nickname,
		 user_password,user_nation,user_gender,user_birthdate,user_session_time,
		 user_regdate,user_email,user_actkey )
		 VALUES( 
		 '".$civlid."'
		 , '".addslashes($_POST['civlname'])."'
		 , '".addslashes($_POST['username'])."'
		 , '".addslashes($_POST['firstname'])."'
		 , '".addslashes($_POST['lastname'])."'
		 , '".addslashes($_POST['nickname'])."'
		 , '".addslashes($_POST['password'])."'
dol_include_once('/product/class/product.class.php');
dol_include_once('/societe/class/societe.class.php');
dol_include_once('/comm/propal/class/propal.class.php');
dol_include_once('/projet/class/project.class.php');
dol_include_once('/projet/class/task.class.php');
dol_include_once('/comm/action/class/actioncomm.class.php');
dol_include_once('/compta/facture/class/facture.class.php');
dol_include_once('/commande/class/commande.class.php');
dol_include_once('/fourn/class/fournisseur.commande.class.php');
dol_include_once('/expedition/class/expedition.class.php');
$langs->load('searcheverywhere@searcheverywhere');
$langs->load('orders');
$get = GETPOST('get');
switch ($get) {
    case 'search':
        _search(GETPOST('type'), GETPOST('keyword'));
        break;
    default:
        break;
}
function _search($type, $keyword)
{
    global $db, $conf, $langs;
    $table = MAIN_DB_PREFIX . $type;
    $objname = ucfirst($type);
    $id_field = 'rowid';
    $complete_label = true;
    $show_find_field = false;
    $sql_join = '';
    if ($type == 'company') {
        $table = MAIN_DB_PREFIX . 'societe';
Ejemplo n.º 6
0
 <input class="submit_button" type="button" name="Submit" value=" Submit " onclick="Submit_Form();"/>
 </div></td>
  </tr>
 
</table>

</form>
</td></tr>
</table>
<?php 
    closeMain();
}
if ($_POST['registerForm'] == 1) {
    if (!($r = _search($_POST['email'], $_POST['civlid'], 'temp'))) {
        if (!($r = _search('', $_POST['civlid'], 'pilots'))) {
            if (!($r = _search($_POST['email'], $_POST['civlid'], 'users'))) {
                // founded none in our database
                // update tables $pilotsTable $CONF['userdb']['users_table'] whith posted form
                $sql1 = "update " . $CONF['userdb']['users_table'] . "  set user_civlid='" . $_POST['civlid'] . "', \n             user_email='" . $_POST['email'] . "' where user_id={$userID}";
                if ($db->sql_query($sql1)) {
                    $civlID = $_POST['civlid'];
                    $sql2 = "select pilotID from {$pilotsTable} where pilotID={$userID}";
                    $result = $db->sql_query($sql2);
                    $user_exist = $db->sql_numrows($result);
                    if ($user_exist) {
                        $sql3 = "update {$pilotsTable} set CIVL_ID='" . $_POST['civlid'] . "', CIVL_NAME='" . addslashes($_POST['name']) . "'WHERE  pilotID='{$userID}' ";
                        if ($db->sql_query($sql3)) {
                            print "<p align='center'>" . _Success_login_civl_or_user . "</p>";
                        }
                    }
                }